...

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

Documentation: cmd/go/testdata/script

     1# Populate go.sum.
     2go get
     3
     4# 'go list -m -retracted' should load retractions, even if the version
     5# containing retractions has a different module path.
     6go list -m -retracted -f '{{with .Retracted}}retracted{{end}}' example.com/retract/rename
     7
     8# 'go list -m -u' should load retractions, too.
     9go list -m -u -f '{{with .Retracted}}retracted{{end}}' example.com/retract/rename
    10
    11# 'go get' should warn about the retracted version.
    12go get
    13stderr '^go: warning: example.com/retract/rename@v1.0.0-bad: retracted by module author: bad$'
    14
    15# We can't upgrade, since this latest version has a different module path.
    16! go get example.com/retract/rename
    17stderr 'module declares its path as: example.com/retract/newname'
    18
    19-- go.mod --
    20module example.com/use
    21
    22go 1.16
    23
    24require example.com/retract/rename v1.0.0-bad
    25-- use.go --
    26package use
    27
    28import _ "example.com/retract/rename"

View as plain text