-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
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 for go get -t
in GOPATH mode is:
The -t flag instructs get to also download the packages required to build
the tests for the specified packages.
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.