I have this code example where I define an array, but it does not compile:
$ cat a.go package f func t() []int { arr := [] int { 1, 2 } return arr } oreyes@OREYES-WIN7 ~/code/go $ go build a.go
However, if I delete a new line, it works:
$ cat a.go package f func t() []int { arr := [] int { 1, 2 } return arr } oreyes@OREYES-WIN7 ~/code/go $ go build a.go
Howcome?
source share