Skip to content

Instantly share code, notes, and snippets.

@aarti
Created September 5, 2016 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aarti/ee295f325bac496ad10595d2724b707a to your computer and use it in GitHub Desktop.
Save aarti/ee295f325bac496ad10595d2724b707a to your computer and use it in GitHub Desktop.
go generic print cannot print array
gore> a:=[]int{1,2,3}
[]int{1, 2, 3}
gore> println(a)
[3/3]0xc420041f20
gore> b:=[3]int{1,2,3}
[3/3]0xc420041ef8
[3]int{1, 2, 3}
gore> println(b)
# command-line-arguments
/var/folders/r0/xqky0mq5773d6bc44pk_xfb00000gp/T/705406632/gore_session.go:10: illegal types for operand: print
[3]int
error: exit status 2
exit status 2
gore>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment