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

     1  # Populate go.sum.
     2  go get
     3  
     4  # 'go list -m -retracted' should load retractions, even if the version
     5  # containing retractions has a different module path.
     6  go list -m -retracted -f '{{with .Retracted}}retracted{{end}}' example.com/retract/rename
     7  
     8  # 'go list -m -u' should load retractions, too.
     9  go list -m -u -f '{{with .Retracted}}retracted{{end}}' example.com/retract/rename
    10  
    11  # 'go get' should warn about the retracted version.
    12  go get
    13  stderr '^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
    17  stderr 'module declares its path as: example.com/retract/newname'
    18  
    19  -- go.mod --
    20  module example.com/use
    21  
    22  go 1.16
    23  
    24  require example.com/retract/rename v1.0.0-bad
    25  -- use.go --
    26  package use
    27  
    28  import _ "example.com/retract/rename"
    29  

View as plain text