On Fri, Sep 8, 2017 at 2:52 PM, DrGo <salah.mah...@gmail.com> wrote: > Sorry if this was asked before, but I could not find any relevant posts. > > Any reason why this struct literal (made up of fields that can be declared > const) is not allowed?
https://golang.org/ref/spec#Constants describes what types of values can be constants. The reason structs can't be constants is to avoid confusion over whether or not they're mutable. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.