Hacker News new | past | comments | ask | show | jobs | submit login

The main issue is none of these though, it's that Go's DCE is generally quite bad so any package you import will lead to significant increases in binary size.

`fmt` is (or was) a big one in every sense of the word, and why using the `print` and `println` builtin functions was sometimes a workaround (probably still is): a few years back, converting a `fmt.Print` call to `print` would save you a cool megabyte (if that was the only cause for importing fmt obviously).

I've always expected that was a major reason for the Go compiler being so anal about unused import, it's essentially making the user perform DCE.




Exactly, if it’s not enforced, people often neglect it. As projects grow, so do unnecessary dependencies.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: