3 ms·
> - Why do go source files even need a package declaration? It serves no useful purpose since the compiler already knows enough to spit out an error if you get
by dan_hawkins 6y ago
> - Why do go source files even need a package declaration? It serves no useful purpose since the compiler already knows enough to spit out an error if you get it wrong.
I know about one use for it: package mypackage_test allows you to exclude test code from builds. I agree with the rest of your points though :)