diff options
author | Jay Conrod <jayconrod@google.com> | 2019-05-31 14:14:00 -0400 |
---|---|---|
committer | Jay Conrod <jayconrod@google.com> | 2019-05-31 23:00:43 +0000 |
commit | 6f7542e4cb6914e8b8d888f16d440feeb8e631d2 (patch) | |
tree | edb490d9208d53c74270f2371e563353c76f168d /src/cmd/go/internal/modload/query.go | |
parent | 64c134f90f0cf6d0e55fca93c433b68810d12f12 (diff) | |
download | go-6f7542e4cb6914e8b8d888f16d440feeb8e631d2.tar.gz go-6f7542e4cb6914e8b8d888f16d440feeb8e631d2.zip |
cmd/go: ignore build tags when 'go get' modifies build list
In module mode, 'go get' should not consider build constraints when
loading packages in order to modify the module graph. With this
change, 'go get' considers all build tags to be true except for
"ignore" and malformed build constraint expressions.
When 'go get' builds packages, it still applies build constraints for
the target platform.
Fixes #32345
Change-Id: I6dceae6f10a5185870537de730b36292271ad124
Reviewed-on: https://go-review.googlesource.com/c/go/+/179898
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/query.go')
-rw-r--r-- | src/cmd/go/internal/modload/query.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/go/internal/modload/query.go b/src/cmd/go/internal/modload/query.go index 218d18373a..5e34bb5e17 100644 --- a/src/cmd/go/internal/modload/query.go +++ b/src/cmd/go/internal/modload/query.go @@ -12,6 +12,7 @@ import ( "strings" "sync" + "cmd/go/internal/imports" "cmd/go/internal/modfetch" "cmd/go/internal/module" "cmd/go/internal/search" @@ -265,7 +266,7 @@ func QueryPattern(pattern, query string, allowed func(module.Version) bool) ([]Q if i := strings.Index(pattern, "..."); i >= 0 { base = pathpkg.Dir(pattern[:i+3]) match = func(m module.Version, root string, isLocal bool) []string { - return matchPackages(pattern, anyTags, false, []module.Version{m}) + return matchPackages(pattern, imports.AnyTags(), false, []module.Version{m}) } } else { match = func(m module.Version, root string, isLocal bool) []string { |