...

Text file src/cmd/go/testdata/script/mod_vendor_gomod.txt

Documentation: cmd/go/testdata/script

     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
     4go mod vendor
     5cd vendor/example.net/x
     6go list all
     7! stdout '^example.net/m'
     8stdout '^example.net/x$'
     9exists ./go.sum
    10
    11cd ../../..
    12go mod edit -go=1.17
    13go mod vendor
    14cd vendor/example.net/x
    15go list all
    16stdout '^example.net/m$'
    17stdout '^example.net/x$'
    18! exists ./go.sum
    19
    20-- go.mod --
    21module example.net/m
    22
    23go 1.16
    24
    25require example.net/x v0.1.0
    26
    27replace example.net/x v0.1.0 => ./x
    28-- m.go --
    29package m
    30
    31import _ "example.net/x"
    32-- x/go.mod --
    33module example.net/x
    34
    35go 1.16
    36-- x/go.sum --
    37-- x/x.go --
    38package x

View as plain text