diff options
| author | Michael Matloob <matloob@golang.org> | 2026-03-08 15:46:36 -0400 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-03-09 10:30:39 -0700 |
| commit | f5d830d57ae0e490d73442d2e04f73322266dbc6 (patch) | |
| tree | cb27d2e424a90d6a80bf1cc95a9831bcc4f657e2 /src/cmd | |
| parent | 16cebc1165d0613051bb5ae97e1af856f8bc55f2 (diff) | |
| download | go-f5d830d57ae0e490d73442d2e04f73322266dbc6.tar.xz | |
cmd/go/internal/testdata: change list_std_vendor to use local modproxy
Also update get_panic_issue75251 to reflect that "golang.org/x/net" now
exists in the proxy. The new message is closer to the real world
behavior of the go command.
Change-Id: Icb916f7eb7628bf5340c15275f4d08086a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/752940
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/go/testdata/mod/golang.org_x_net_v0.1.0.txt | 10 | ||||
| -rw-r--r-- | src/cmd/go/testdata/script/get_panic_issue75251.txt | 2 | ||||
| -rw-r--r-- | src/cmd/go/testdata/script/list_std_vendor.txt | 29 |
3 files changed, 37 insertions, 4 deletions
diff --git a/src/cmd/go/testdata/mod/golang.org_x_net_v0.1.0.txt b/src/cmd/go/testdata/mod/golang.org_x_net_v0.1.0.txt new file mode 100644 index 0000000000..66904b6c3f --- /dev/null +++ b/src/cmd/go/testdata/mod/golang.org_x_net_v0.1.0.txt @@ -0,0 +1,10 @@ +written by hand - just enough for list_std_vendor.txt + +-- .mod -- +module golang.org/x/net +-- .info -- +{"Version":"v0.1.0","Name":"","Short":"","Time":"2026-03-08T00:00:00Z"} +-- go.mod -- +module golang.org/x/net +-- dns/dnsmessage/dnsmessage.go -- +package dnsmessage diff --git a/src/cmd/go/testdata/script/get_panic_issue75251.txt b/src/cmd/go/testdata/script/get_panic_issue75251.txt index 2cc3f3a9c4..00d019f865 100644 --- a/src/cmd/go/testdata/script/get_panic_issue75251.txt +++ b/src/cmd/go/testdata/script/get_panic_issue75251.txt @@ -5,7 +5,7 @@ go mod init m ! go get golang.org/x/net/http/httpguts˙v0.43.0 # contains 0xff byte ! stderr panic -stderr 'malformed module path' +stderr 'module golang.org/x/net@upgrade found.*but does not contain package golang.org/x/net/http/httpguts.v0.43.0' ! go get golang.org/x/net/http/httpguts˙@v0.43.0 # contains 0xff byte ! stderr panic diff --git a/src/cmd/go/testdata/script/list_std_vendor.txt b/src/cmd/go/testdata/script/list_std_vendor.txt index 834babe674..06674ff41e 100644 --- a/src/cmd/go/testdata/script/list_std_vendor.txt +++ b/src/cmd/go/testdata/script/list_std_vendor.txt @@ -2,6 +2,8 @@ # dependencies regardless of whether they are listed from within or outside # GOROOT/src. +env GOROOT=$WORK/goroot + # Control case: net, viewed from outside the 'std' module, # should depend on vendor/golang.org/… instead of golang.org/…. @@ -25,9 +27,30 @@ cmp stdout $WORK/net-deps.txt # However, 'go mod' and 'go get' subcommands should report the original module # dependencies, not the vendored packages. -[!net:golang.org] stop - -env GOPROXY= env GOWORK=off go mod why -m golang.org/x/net stdout '^# golang.org/x/net\nnet\ngolang.org/x/net' + +-- $WORK/goroot/src/go.mod -- +module std + +go 1.26 + +require golang.org/x/net v0.1.0 +-- $WORK/goroot/src/go.sum -- +golang.org/x/net v0.1.0 h1:iUcD2VNMwNi3BZMUg2qIGo4aAass7E0R4eQNGK3hvc0= +golang.org/x/net v0.1.0/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +-- $WORK/goroot/src/vendor/modules.txt -- +# golang.org/x/net v0.1.0 +## explicit +golang.org/x/net/dns/dnsmessage +-- $WORK/goroot/src/vendor/modules.txt -- +# golang.org/x/net v0.1.0 +## explicit +golang.org/x/net/dns/dnsmessage +-- $WORK/goroot/src/vendor/golang.org/x/net/dns/dnsmessage/dnsmessage.go -- +package dnsmessage +-- $WORK/goroot/src/net/net.go -- +package net + +import _ "golang.org/x/net/dns/dnsmessage" |
