...

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

Documentation: cmd/go/testdata/script

     1# https://golang.org/issue/44296: the --versions flag should not affect
     2# the version reported by 'go list' in case of retractions.
     3
     4env FMT='{{.Path}}{{with .Error}}: {{printf "%q" .Err}}{{end}} {{printf "%q" .Version}}{{with .Versions}} {{.}}{{end}}'
     5
     6go list -m -e -f $FMT example.com/retract/self/pseudo
     7stdout '^example.com/retract/self/pseudo: "module example.com/retract/self/pseudo: not a known dependency" ""$'
     8
     9go list -m -e -f $FMT example.com/retract/self/pseudo@latest
    10stdout '^example.com/retract/self/pseudo: "module example.com/retract/self/pseudo: no matching versions for query \\"latest\\"" "latest"$'
    11
    12
    13go list -m -e -f $FMT --versions example.com/retract/self/pseudo
    14stdout '^example.com/retract/self/pseudo ""$'
    15
    16go list -m -e -f $FMT --versions example.com/retract/self/pseudo@latest
    17stdout '^example.com/retract/self/pseudo: "module example.com/retract/self/pseudo: no matching versions for query \\"latest\\"" "latest"$'
    18
    19-- go.mod --
    20module test
    21
    22go 1.17

View as plain text