env GO111MODULE=on

cp go.mod.empty go.mod
go get gopkg.in/dummy.v2-unstable

cp x.go.txt x.go
cp go.mod.empty go.mod
go list

[!net:gopkg.in] skip
[!git] skip

skip  # TODO(#54503): redirect gopkg.in requests to a local server and re-enable.

env GOPROXY=direct
env GOSUMDB=off
go get gopkg.in/macaroon-bakery.v2-unstable/bakery
go list -m all
stdout 'gopkg.in/macaroon-bakery.v2-unstable v2.0.0-[0-9]+-[0-9a-f]+$'

-- go.mod.empty --
module m

-- x.go.txt --
package x
import _ "gopkg.in/dummy.v2-unstable"
