-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: fix tests when go.env sets GOPROXY=direct GOSUMDB=off
Tested locally by changing GOROOT/go.env. At some point perhaps we should also set up a builder that runs with some common expected modifications to go.env (such as GOTOOLCHAIN=local GOPROXY=direct GOSUMDB=off). Fixes golang#61358. Updates golang#61359. Change-Id: I365ec536bec86370e302fb726fa897400ab42cf3 Reviewed-on: https://go-review.googlesource.com/c/go/+/509637 TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Russ Cox <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]>
- Loading branch information
Showing
7 changed files
with
48 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,9 @@ env GOPROXY= | |
env GOSUMDB= | ||
|
||
# github.com/russross/blackfriday v2.0.0+incompatible exists, | ||
# and should be resolved if we ask for v2.0 explicitly. | ||
# and should be resolved if we ask for it explicitly. | ||
|
||
go list -m github.com/russross/[email protected] | ||
go list -m github.com/russross/[email protected].0+incompatible | ||
stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$' | ||
|
||
# blackfriday v1.5.2 has a go.mod file, so v1.5.2 should be preferred over | ||
|
@@ -27,6 +27,7 @@ stdout '^github.com/russross/blackfriday v1\.' | |
! go list -m github.com/russross/blackfriday@patch | ||
stderr '^go: github.com/russross/blackfriday@patch: can''t query version "patch" of module github.com/russross/blackfriday: no existing version is required$' | ||
|
||
|
||
# If we're fetching directly from version control, ignored +incompatible | ||
# versions should also be omitted by 'go list'. | ||
|
||
|
@@ -38,10 +39,23 @@ stderr '^go: github.com/russross/blackfriday@patch: can''t query version "patch" | |
[!git] stop | ||
env GOPROXY=direct | ||
|
||
go list -versions -m github.com/russross/blackfriday github.com/russross/blackfriday | ||
go list -versions -m github.com/russross/blackfriday | ||
stdout '^github.com/russross/blackfriday v1\.5\.1 v1\.5\.2' # and possibly others | ||
! stdout ' v2\.' | ||
|
||
# For this module, v2.1.0 exists and has a go.mod file. | ||
# 'go list -m github.com/russross/[email protected]' will check | ||
# the latest v2.0 tag, discover that it isn't the right module, and stop there | ||
# (instead of spending the time to check O(N) previous tags). | ||
|
||
! go list -m github.com/russross/[email protected] | ||
stderr '^go: module github.com/russross/blackfriday: no matching versions for query "v2\.0\"' | ||
|
||
# (But asking for exactly v2.0.0+incompatible should still succeed.) | ||
go list -m github.com/russross/[email protected]+incompatible | ||
stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$' | ||
|
||
|
||
# However, if the latest compatible version does not include a go.mod file, | ||
# +incompatible versions should still be listed, as they may still reflect the | ||
# intent of the module author. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters