-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go/internal/modfetch: filter pseudo-versions from proxy /list end…
…points The /list files in the module cache include pseudo-versions, but the documentation for (*modfetch).Repo.Versions explicitly states that they are not included in the output of that method. Fixes #32715 Change-Id: Ieba1500b91f52b5fa689e70e16dbe3ad40de20f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/183402 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
- Loading branch information
Bryan C. Mills
committed
Jun 25, 2019
1 parent
e28f0d9
commit 1969005
Showing
5 changed files
with
123 additions
and
11 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
10 changes: 10 additions & 0 deletions
10
.../go/testdata/mod/github.com_dmitshur-test_modtest5_v0.0.0-20190619020302-197a620e0c9a.txt
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module github.com/dmitshur-test/[email protected] | ||
|
||
-- .mod -- | ||
module github.com/dmitshur-test/modtest5 | ||
-- .info -- | ||
{"Version":"v0.0.0-20190619020302-197a620e0c9a","Time":"2019-06-18T19:03:02-07:00"} | ||
-- p.go -- | ||
package p | ||
|
||
const v = 1 |
10 changes: 10 additions & 0 deletions
10
...data/mod/github.com_dmitshur-test_modtest5_v0.5.0-alpha.0.20190619023908-3da23a9deb9e.txt
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module github.com/dmitshur-test/[email protected] | ||
|
||
-- .mod -- | ||
module github.com/dmitshur-test/modtest5 | ||
-- .info -- | ||
{"Version":"v0.5.0-alpha.0.20190619023908-3da23a9deb9e","Time":"2019-06-18T19:39:08-07:00"} | ||
-- p.go -- | ||
package p | ||
|
||
const v = 3 |
10 changes: 10 additions & 0 deletions
10
src/cmd/go/testdata/mod/github.com_dmitshur-test_modtest5_v0.5.0-alpha.txt
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module github.com/dmitshur-test/[email protected] | ||
|
||
-- .mod -- | ||
module github.com/dmitshur-test/modtest5 | ||
-- .info -- | ||
{"Version":"v0.5.0-alpha","Time":"2019-06-18T19:04:46-07:00"} | ||
-- p.go -- | ||
package p | ||
|
||
const v = 2 |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
env GO111MODULE=on | ||
|
||
# Regression test for golang.org/issue/32715. | ||
|
||
# When using $GOPATH/pkg/mod/cache/download as a proxy, | ||
# 'latest' queries should prefer tagged versions over pseudo-versions. | ||
|
||
go mod download github.com/dmitshur-test/[email protected] | ||
go mod download github.com/dmitshur-test/[email protected] | ||
go mod download github.com/dmitshur-test/[email protected] | ||
cmp $GOPATH/pkg/mod/cache/download/github.com/dmitshur-test/modtest5/@v/list $WORK/modtest5.list | ||
|
||
env GOPROXY=file:///$GOPATH/pkg/mod/cache/download | ||
env GOPATH=$WORK/gopath2 | ||
mkdir $GOPATH | ||
|
||
go list -m -json github.com/dmitshur-test/modtest5@latest | ||
cmp stdout $WORK/modtest5.json | ||
|
||
# If the module proxy contains only pseudo-versions, 'latest' should stat | ||
# the version with the most recent timestamp — not the highest semantic | ||
# version — and return its metadata. | ||
env GOPROXY=file:///$WORK/tinyproxy | ||
go list -m -json dmitri.shuralyov.com/test/modtest3@latest | ||
cmp stdout $WORK/modtest3.json | ||
|
||
-- $WORK/modtest5.list -- | ||
v0.0.0-20190619020302-197a620e0c9a | ||
v0.5.0-alpha | ||
v0.5.0-alpha.0.20190619023908-3da23a9deb9e | ||
-- $WORK/modtest5.json -- | ||
{ | ||
"Path": "github.com/dmitshur-test/modtest5", | ||
"Version": "v0.5.0-alpha", | ||
"Time": "2019-06-18T19:04:46-07:00" | ||
} | ||
-- $WORK/tinyproxy/dmitri.shuralyov.com/test/modtest3/@v/list -- | ||
v0.1.0-0.20161023043300-000000000000 | ||
v0.0.0-20181023043359-a85b471d5412 | ||
-- $WORK/tinyproxy/dmitri.shuralyov.com/test/modtest3/@v/v0.0.0-20181023043359-a85b471d5412.info -- | ||
{ | ||
"Version": "v0.0.0-20181023043359-a85b471d5412", | ||
"Time": "2018-10-22T21:33:59-07:00" | ||
} | ||
-- $WORK/modtest3.json -- | ||
{ | ||
"Path": "dmitri.shuralyov.com/test/modtest3", | ||
"Version": "v0.0.0-20181023043359-a85b471d5412", | ||
"Time": "2018-10-22T21:33:59-07:00" | ||
} |