diff options
author | Bryan C. Mills <bcmills@google.com> | 2019-03-15 14:58:40 -0400 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2019-04-01 16:37:07 +0000 |
commit | a7fc71092dfb6c6d5fef09b8c85b7d9e78908717 (patch) | |
tree | c1a789f5c4f799848f75950a298b3f242101b9f5 /src/cmd/go/internal/modload/load.go | |
parent | d6b2b35e641eeac9f764d21dcaed46973b3e2720 (diff) | |
download | go-a7fc71092dfb6c6d5fef09b8c85b7d9e78908717.tar.gz go-a7fc71092dfb6c6d5fef09b8c85b7d9e78908717.zip |
cmd/go/internal/modget: support the suffix '@patch' in 'go get'
As of this change, an explicit '@patch' suffix is to '-u=patch' as
'@latest' is to '-u'.
RELNOTE='go get' in module mode now supports the version suffix '@patch'.
Fixes #26812
Change-Id: Ib5eee40de640440f7470d37a574b311ef8a67f67
Reviewed-on: https://go-review.googlesource.com/c/go/+/167747
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/cmd/go/internal/modload/load.go')
-rw-r--r-- | src/cmd/go/internal/modload/load.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index 57c2dd25a6..d55e0c5403 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -339,7 +339,7 @@ func loadAll(testAll bool) []string { if !testAll { loaded.testRoots = true } - all := TargetPackages() + all := TargetPackages("...") loaded.load(func() []string { return all }) WriteGoMod() @@ -357,10 +357,11 @@ func loadAll(testAll bool) []string { // Only "ignore" and malformed build tag requirements are considered false. var anyTags = map[string]bool{"*": true} -// TargetPackages returns the list of packages in the target (top-level) module, -// under all build tag settings. -func TargetPackages() []string { - return matchPackages("...", anyTags, false, []module.Version{Target}) +// TargetPackages returns the list of packages in the target (top-level) module +// matching pattern, which may be relative to the working directory, under all +// build tag settings. +func TargetPackages(pattern string) []string { + return matchPackages(pattern, anyTags, false, []module.Version{Target}) } // BuildList returns the module build list, |