pkg dir origins

This commit is contained in:
Kyle Quest
2021-05-11 13:07:44 -07:00
parent 23bda496bb
commit 3d3c1d6333
2 changed files with 6 additions and 1 deletions

View File

@@ -74,6 +74,8 @@ See the [`/pkg`](pkg/README.md) directory if you want to see which popular Go re
It's ok not to use it if your app project is really small and where an extra level of nesting doesn't add much value (unless you really want to :-)). Think about it when it's getting big enough and your root directory gets pretty busy (especially if you have a lot of non-Go app components).
The `pkg` directory origins: The old Go source code used to use `pkg` for its packages and then various Go projects in the community started copying the patteren (see [`this`](https://twitter.com/bradfitz/status/1039512487538970624) Brad Fitzpatrick's tweet for more context).
### `/vendor`
Application dependencies (managed manually or by your favorite dependency management tool like the new built-in [`Go Modules`](https://github.com/golang/go/wiki/Modules) feature). The `go mod vendor` command will create the `/vendor` directory for you. Note that you might need to add the `-mod=vendor` flag to your `go build` command if you are not using Go 1.14 where it's on by default.