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
cmd/go/internal/modload: return a module-only result from QueryPattern
This allows a single QueryPattern call to resolve a path that could be
either a package or a module. It is important to be able to make a
single QueryPattern call — rather than a QueryPattern followed by a
Query for the specific module path — to provide appropriate fallback
behavior: if the proxy returns package results but does not contain a
module result, we don't want to fall back to the next proxy to look
for the (probably-nonexistent) module.
For #37438
Change-Id: I419b8bb3ab4565f443bb5cee9a8b206f453b9801
Reviewed-on: https://go-review.googlesource.com/c/go/+/266657
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Copy file name to clipboardExpand all lines: src/cmd/go/testdata/script/mod_get_downgrade_missing.txt
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,24 @@ cp go.mod go.mod.orig
3
3
# getting a specific version of a module along with a pattern
4
4
# not yet present in that module should report the version mismatch
5
5
# rather than a "matched no packages" warning.
6
+
6
7
! go get example.net/pkgadded@v1.1.0 example.net/pkgadded/subpkg/...
7
8
stderr '^go get: conflicting versions for module example\.net/pkgadded: v1\.1\.0 and v1\.2\.0$'
8
9
! stderr 'matched no packages'
9
10
cmp go.mod.orig go.mod
10
11
11
-
! go get example.net/pkgadded/...@v1.0.0
12
-
stderr '^go get example\.net/pkgadded/\.\.\.@v1\.0\.0: module example\.net/pkgadded@v1\.0\.0 found, but does not contain packages matching example\.net/pkgadded/\.\.\.$'
13
-
cmp go.mod.orig go.mod
12
+
13
+
# A wildcard pattern should match a package in a module with that path.
14
+
15
+
go get example.net/pkgadded/...@v1.0.0
16
+
go list -m all
17
+
stdout '^example.net/pkgadded v1.0.0'
18
+
cp go.mod.orig go.mod
19
+
20
+
21
+
# If we need to resolve a transitive dependency of a package,
22
+
# and another argument constrains away the version that provides that
23
+
# package, then 'go get' should fail with a useful error message.
14
24
15
25
! go get example.net/pkgadded@v1.0.0 .
16
26
stderr -count=1 '^go: found example.net/pkgadded/subpkg in example.net/pkgadded v1\.2\.0$' # TODO: We shouldn't even try v1.2.0.
0 commit comments