4 ms·
A point I don't see mentioned often enough is a couple of points about the compiler's poor DX for iterative development. Go will fail to build if you have unus
by rgoulter 6y ago
A point I don't see mentioned often enough is a couple of points about the compiler's poor DX for iterative development.
Go will fail to build if you have unused dependencies or variables. (And it's easy to use the convenient `:=` in a way which faces problems exacerbated by this).
If I'm debugging through something, I might be adding packages or intermediate calculations to try and figure out what's going wrong. But because the Go compiler enforces this proper style of "nothing unused", there's that much more friction when tinkering.
- papaf 6y agoI highly recommend using goimports to format your code on save: https://godoc.org/golang.org/x/tools/cmd/goimports https://godoc.org/golang.org/x/tools/cmd/goimports This will hopefully reduce some of the friction you are having.