...

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

Documentation: cmd/go/testdata/script

     1env GO111MODULE=on
     2
     3go get rsc.io/quote@v1.5.1
     4go list -m all
     5stdout 'rsc.io/quote v1.5.1'
     6grep 'rsc.io/quote v1.5.1$' go.mod
     7
     8# get -u should update dependencies of the package in the current directory
     9go get -u
    10grep 'rsc.io/quote v1.5.2$' go.mod
    11grep 'golang.org/x/text [v0-9a-f\.-]+ // indirect' go.mod
    12
    13# get -u rsc.io/sampler should update only sampler's dependencies
    14cp go.mod-v1.5.1 go.mod
    15go get -u rsc.io/sampler
    16grep 'rsc.io/quote v1.5.1$' go.mod
    17grep 'golang.org/x/text [v0-9a-f\.-]+ // indirect' go.mod
    18
    19# move to a pseudo-version after any tags
    20go get rsc.io/quote@dd9747d
    21grep 'rsc.io/quote v0.0.0-20180628003336-dd9747d19b04' go.mod
    22
    23# get -u should not jump off newer pseudo-version to earlier tag
    24go get -u
    25grep 'rsc.io/quote v0.0.0-20180628003336-dd9747d19b04' go.mod
    26
    27# move to earlier pseudo-version
    28go get rsc.io/quote@e7a685a342
    29grep 'rsc.io/quote v0.0.0-20180214005133-e7a685a342c0' go.mod
    30
    31# get -u should jump off earlier pseudo-version to newer tag
    32go get -u
    33grep 'rsc.io/quote v1.5.2' go.mod
    34
    35-- go.mod --
    36module x
    37require rsc.io/quote v1.1.0
    38
    39-- go.mod-v1.5.1 --
    40module x
    41require rsc.io/quote v1.5.1
    42
    43-- use.go --
    44package use
    45
    46import _ "rsc.io/quote"

View as plain text