...
Text file
src/cmd/go/testdata/script/mod_fileproxy_vcs_missing_issue51589.txt
1# This test checks that "go mod tidy -e" do not panic when
2# using a file goproxy that is missing some modules.
3# Verifies golang.org/issue/51589
4
5# download the modules first
6env GO111MODULE=on
7env GOPATH=$WORK/gopath
8cd $WORK/x
9go mod tidy
10
11# Use download cache as file:/// proxy.
12[GOOS:windows] env GOPROXY=file:///$WORK/gopath/pkg/mod/cache/download
13[!GOOS:windows] env GOPROXY=file://$WORK/gopath/pkg/mod/cache/download
14rm $WORK/gopath/pkg/mod/cache/download/golang.org/x/text/
15go mod tidy -e
16stderr '^go: rsc.io/sampler@v1.3.0 requires\n\tgolang.org/x/text@.*: reading file://.*/pkg/mod/cache/download/golang.org/x/text/.*'
17! stderr 'signal SIGSEGV: segmentation violation'
18
19-- $WORK/x/go.mod --
20module example.com/mod
21
22go 1.17
23
24require rsc.io/quote v1.5.2
25
26require (
27 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c // indirect
28 rsc.io/sampler v1.3.0 // indirect
29)
30
31-- $WORK/x/x.go --
32package mod
33
34import (
35 "fmt"
36
37 "rsc.io/quote"
38)
39
40func Echo() {
41 fmt.Println(quote.Hello())
42}
View as plain text