You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There have been a number of requests for a test dependencies section in go.mod. These requests actually don't make sense with the way that go.mod works, because it's really just a list of rules to follow for resolving dependencies, not a list of dependencies. The actual list of dependencies is per-package, not per-module, and is determined by the actual import statements in the code itself. The go tool, however, does add some extra information to the go.mod file in the form of an // indirect comment after dependencies that are only depended on by a dependency.
I propose adding an alternate comment flag, test, to indicate that a dependency is only required by tests. Along with this, add an indication of this to the Module struct used for formatting go list -m output.
The text was updated successfully, but these errors were encountered:
rsc
changed the title
proposal: mark test dependencies in go.mod and go list -m
proposal: cmd/go: mark test dependencies in go.mod and go list -m
Aug 10, 2022
There have been a number of requests for a test dependencies section in
go.mod
. These requests actually don't make sense with the way thatgo.mod
works, because it's really just a list of rules to follow for resolving dependencies, not a list of dependencies. The actual list of dependencies is per-package, not per-module, and is determined by the actualimport
statements in the code itself. Thego
tool, however, does add some extra information to thego.mod
file in the form of an// indirect
comment after dependencies that are only depended on by a dependency.I propose adding an alternate comment flag,
test
, to indicate that a dependency is only required by tests. Along with this, add an indication of this to theModule
struct used for formattinggo list -m
output.The text was updated successfully, but these errors were encountered: