Closed dyllanwli closed 6 years ago
This is an issue with the underlying interpreter gomacro. The interpreter doesn't have support for the type inference that the go compiler performs on composite literals like this. The solution until that is implemented is to simply include the type when writing the literal:
var p = map[string][]string{"world":[]string{"hello"}}
I've opened up an issue cosmos72/gomacro#9 related to this over at gomacro.
Thanks @SpencerPark!
I updated the title of this issue to track this on our side.
Define a map and the cell returns an error:
But if I define a empty map and it will not raise a panic.
Why this error happened? Could anyone help me to fix that?