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>
This commit is contained in:
Michael Matloob
2026-03-08 15:46:36 -04:00
committed by Gopher Robot
parent 16cebc1165
commit f5d830d57a
3 changed files with 37 additions and 4 deletions

View File

@@ -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

View File

@@ -5,7 +5,7 @@ go mod init m
! go get golang.org/x/net/http/httpguts<74>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<74>@v0.43.0 # contains 0xff byte
! stderr panic

View File

@@ -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"