Hacker News new | ask | show | jobs
by throwaway143829 908 days ago
In Go, consts can only be used for primitives like 42, "foo" etc. - not structs, because the language doesn't have a concept of immutability (and so wouldn't be able to enforce const-ness) except for primitives.

More info here: https://go.dev/blog/constants