Go 2.0: Retain simplicity by trading features
Sindre Myren
161

I would much rather see Go eliminate globally assignable package exports, where assignable means overwriting the underlying value or replacing an element in index operation. Note: this is not true immutability; that’s not what I am advocating.

The Go ecosystem would see far fewer knock-on effects from a restriction like this. I would hate to see package initializers go away, because the Go specification guarantees their execution per topological sort order of the executable’s import graph. This has immense value for loosely-coupled and composed systems where static registration is a must — e.g., Protocol Buffers and their extensions.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.