Now that Go undergoes mainstream adoption, you can witness a hunger for more and more convention. The core guidelines are impressive, but obviously they can not cover everything. The following sections address some ongoing attempts on the matter.
All code is pkg
if the definition is "library code that's OK to use by external applications”, with the exception for main
packages and any code placed in an internal
(sub)directory. Using pkg
is the same redundancy as using src
in a source code repository/directory, or a java
directory with .java
files.
Yes, there are many projects that don't write APIs in a reusable manner, just like many projects don't follow the compatibility rules from the semantic versioning model. None of it means that we need extra nesting to get it right.