There are packages in the standard library in conflict with this: bytes, errors and strings.
@vladimiroff I don't think those are counter-examples. Neither bytes
, errors
, nor strings
are collections. They're individual packages.
By collection, I mean something like...
It contains encoding/json
, encoding/xml
, encoding/gob
, etc. Notice how it's encoding/json
and not encodings/json
. It's because the collection folder encoding
uses singular form.
Also, this suggestion is primarily for empty folder names that simply contain many packages.
Do this:
Don't do this:
Notice how "example", "image", "player" folder names simply contain many related packages, yet they use singular form.
Because it's consistent with the style the Go project uses.