github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_get_main.txt (about)

     1  env GO111MODULE=on
     2  [short] skip
     3  
     4  # @patch and @latest within the main module refer to the current version.
     5  # The main module won't be upgraded, but missing dependencies will be added.
     6  cp go.mod.orig go.mod
     7  go get -d rsc.io/x
     8  grep 'rsc.io/quote v1.5.2' go.mod
     9  go get -d rsc.io/x@upgrade
    10  grep 'rsc.io/quote v1.5.2' go.mod
    11  cp go.mod.orig go.mod
    12  go get -d rsc.io/x@patch
    13  grep 'rsc.io/quote v1.5.2' go.mod
    14  cp go.mod.orig go.mod
    15  
    16  # The main module cannot be updated to @latest, which is a specific version.
    17  ! go get -d rsc.io/x@latest
    18  stderr '^go get rsc.io/x@latest: can.t request explicit version of path in main module$'
    19  
    20  # The main module cannot be updated to a specific version.
    21  ! go get rsc.io/x@v0.1.0
    22  stderr '^go get rsc.io/x@v0.1.0: can.t request explicit version of path in main module$'
    23  ! go get -d rsc.io/x@v0.1.0
    24  stderr '^go get rsc.io/x@v0.1.0: can.t request explicit version of path in main module$'
    25  
    26  # Upgrading a package pattern not contained in the main module should not
    27  # attempt to upgrade the main module.
    28  go get -d rsc.io/quote/...@v1.5.1
    29  grep 'rsc.io/quote v1.5.1' go.mod
    30  
    31  -- go.mod.orig --
    32  module rsc.io
    33  
    34  go 1.13
    35  -- x/x.go --
    36  package x
    37  
    38  import _ "rsc.io/quote"