1 # https://golang.org/issue/42970: As of Go 1.17, go.mod and go.sum files should
2 # be stripped from vendored dependencies.
3
4 go mod vendor
5 cd vendor/example.net/x
6 go list all
7 ! stdout '^example.net/m'
8 stdout '^example.net/x$'
9 exists ./go.sum
10
11 cd ../../..
12 go mod edit -go=1.17
13 go mod vendor
14 cd vendor/example.net/x
15 go list all
16 stdout '^example.net/m$'
17 stdout '^example.net/x$'
18 ! exists ./go.sum
19
20 -- go.mod --
21 module example.net/m
22
23 go 1.16
24
25 require example.net/x v0.1.0
26
27 replace example.net/x v0.1.0 => ./x
28 -- m.go --
29 package m
30
31 import _ "example.net/x"
32 -- x/go.mod --
33 module example.net/x
34
35 go 1.16
36 -- x/go.sum --
37 -- x/x.go --
38 package x
39
View as plain text