cmd/go: 'go get' should consider test dependencies in module mode #32037
Labels
FrozenDueToAge
modules
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
Since CL 174099,
go get
in module mode expands each of its arguments to a set of packages, then upgrades or downgrades the modules providing those packages. If the-u
flag is given, modules providing transitively imported packages will also be upgraded, but this does not consider test imports.In 1.12,
go get
only considered modules: command line arguments were matched against modules in the build list. There was no need to consider test dependencies, since this is not a meaningful concept at the module level.With the new behavior, we upgrade fewer modules, and there's no convenient way to upgrade test dependencies for the main module.
all
is the only pattern that considers test dependencies, and it includes test dependencies for packages in other modules.I propose we bring back the
-t
flag in module mode. The description forgo get -t
in GOPATH mode is:The change to flip this back on would be pretty small. However, this would be a fairly visible behavioral change after the 1.13 freeze, so perhaps we should wait for 1.14. Alternatively, we could consider test dependencies by default.
cc @rsc @bcmills @thepudds
The text was updated successfully, but these errors were encountered: