go.mod: split the indirect packages#2331
Conversation
|
Are there some links we can read up on about this being the recommended way to layout go.mod now? |
|
@tonistiigi I will look for it later, but at least it is specified out below. https://golang.org/ref/mod#go-mod-file-go
Actually,
That means, as a premise, when go.mod See also: https://golang.org/ref/mod#graph-pruning |
|
@tonistiigi Also, https://golang.org/doc/go1.17#go-command
|
|
@zchee This needs rebase |
After go1.17, all indirect packages are listed in the go.mod file. In addition, has been introduced the ability to list indirect packages separately. Split the indirect packages to make the dependency packages clearer. Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
|
@tonistiigi done |
| // snappy: updated for go1.17 support | ||
| github.com/golang/snappy v0.0.4-0.20210608040537-544b4180ac70 // indirect |
There was a problem hiding this comment.
Do we know if the second require block is ignored by older go version, or is it also used?
The thing that surprised me a bit is that some of these // indirect were not automatically created by go mod, but were manually added to force using a more current version.
I think this import for example (based on the comment) is a manual override, but also github.com/cpuguy83/go-md2man/v2, and some others. I'd have expected go to only put the "automatically collected" imports in the second block, but to keep the "manual overrides" to be in the first block.
There was a problem hiding this comment.
@thaJeztah make sense. will check go1.17 go mod behavior and send PR again
Split the
indirectpackages of go.mod.After go1.17, all
indirectpackages are listed in the go.mod file.In addition, has been introduced the ability to list
indirectpackages separately.Split the
indirectpackage to make the dependency packages clearer.This pull request is no-op to codes, just formatted.