github.com/megatontech/mynoteforgo@v0.0.0-20200507084910-5d0c6ea6e890/源码/cmd/go/testdata/script/mod_vendor_build.txt (about)

     1  env GO111MODULE=on
     2  
     3  # initial conditions: using sampler v1.3.0, not listed in go.mod.
     4  go list -deps
     5  stdout rsc.io/sampler
     6  ! grep 'rsc.io/sampler v1.3.0' go.mod
     7  
     8  # update to v1.3.1, now indirect in go.mod.
     9  go get rsc.io/sampler@v1.3.1
    10  grep 'rsc.io/sampler v1.3.1 // indirect' go.mod
    11  cp go.mod go.mod.good
    12  
    13  # vendoring can but should not need to make changes.
    14  go mod vendor
    15  cmp go.mod go.mod.good
    16  
    17  # go list -mod=vendor (or go build -mod=vendor) must not modify go.mod.
    18  # golang.org/issue/26704
    19  go list -mod=vendor
    20  cmp go.mod go.mod.good
    21  
    22  -- go.mod --
    23  module m
    24  
    25  -- x.go --
    26  package x
    27  import _ "rsc.io/quote"