Skip to content

Commit

Permalink
More details about clutter and pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Oct 19, 2024
1 parent 44a3d85 commit aaeb788
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/_posts/2024-10-19-no-nonsense-go-package-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ You don't need that, unless you're shipping code to _a lot_ of third party users
#### pkg/

Any package you put into a pkg directory can be moved the root.
`pkg` is a very outdated convention.
`pkg` is a very outdated convention from before `internal/` (and you saw what I think about internal/).

Some people think that having packages at the top, "clutters", the directory... first what does get cluttered if you add unnecessary directory layers is every single import in dozen of files and possibly hundreds of dependencies... think about them... Second, feel free to move the various docs etc to some subdirectory. Lastly what is 'clutter' navigation probably comes through your "godoc".

Btw don't get me started with repos that have dozens of files and that to see what is going on not using an idea you have to go main.go -> some other file -> some init file -> some start function -> some other files... while all this could be in 1 or 2 places, easier to follow and find.

#### util/

Expand Down

0 comments on commit aaeb788

Please sign in to comment.