Go best practices, six years in (2016)
This is generally great advice, and aside from the package manager recommendations is still relevant today. I do take issue with a few things though.<p>1. Don&#x27;t put your internal libraries in &#x2F;pkg. &#x2F;pkg has special GOPATH meaning as &quot;compilation cache&quot;. Its not an actual name conflict, but why bother risking it.<p>2. This is just wrong:<p>&gt; fmt.Printf is self-contained and doesn’t affect or depend on global state; in functional terms, it has something like referential transparency. So it is not a dependency. Obviously, f.Bar is a dependency. And, interestingly, log.Printf acts on a package-global logger object, it’s just obscured behind the free function Printf. So it, too, is a dependency.<p>stdout (and the buffer, and mutex on it) are exactly the same as the global log object. In fact, `log.Printf` is more or less just an alias to `fmt.Printf`[0]<p>3. I wish it had mentioned the functional options pattern in the part about constructors[1]<p>0: <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;blob&#x2F;b77aad089176ecab971d3a72f0357ed0abc81f4a&#x2F;src&#x2F;log&#x2F;log.go#L294" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;blob&#x2F;b77aad089176ecab971d3a72f0...</a><p>1: <a href="https:&#x2F;&#x2F;dave.cheney.net&#x2F;2014&#x2F;10&#x2F;17&#x2F;functional-options-for-friendly-apis" rel="nofollow">https:&#x2F;&#x2F;dave.cheney.net&#x2F;2014&#x2F;10&#x2F;17&#x2F;functional-options-for-fr...</a>