I want to declare a constant golang 2d array (not slices), but I can't figure it out, having looked at the other golang comments on this issue.
type fooT [1][1]float64
const BAR fooT = {[1]float64 {.01}}
Gives the error fubar.go:5: syntax error: unexpected {
. But the following compiles fine:
type fooT [1][1]float64
var BAR = fooT {[1]float64 {.01}}
First, I do not understand why I need to redeclare the underlying array redundantly, and it does seem golang compiler knows the type because it gives an error if I change it. But, why can I not make this array a const? it is R/O, not a global.
And, the syntax is cumbersome.