Follow

i don't understand why unused imports and unused variables are errors in golang. do you? can you explain it to me?

@sneak unused imports have an analysis cost which increase build times when committed into a code base. Have that happen over a large group and you get a significant build speed penalty eventually. My work put in a git hook to force delete unused imports for that exact reason.

Golang optimized for build speed when developing with a large amount of devs in one project. No unused vars and imports is a very common mandatory lint.

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!