News for hackers. Stuff that matters.
Re:The Zen of Go by ofrzeta on Sunday February 23, 2020 @09:17AM (#22396909)
Why does it have to be the compiler? The thing about unused variables seems quite arbitrary to me. There are also other things the Go compiler doesn't enforce.

Why not pick a tool that's specialized for stuff like that, like a style checker. Put it into the build pipeline and let the build fail if the code doesn't adhere to your standards.

Re:The Zen of Go by sagichmal on Sunday February 23, 2020 @09:37AM (#22396996)
Because I don't want unused variables to be something other people can opt-in to. I want all source code to be free of unused variables always.
Re:The Zen of Go by masklinn on Sunday February 23, 2020 @04:49PM (#22399776)
> There are also other things the Go compiler doesn't enforce.

Importantly, there are a number of almost certain bugs the Go compiler is happy to let through without even a warning.

Like not rebinding the result of append(), or not checking the error returned by a function.