...

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

Documentation: cmd/go/testdata/script

     1# Regression test for https://golang.org/issue/37438.
     2#
     3# If a path exists at the requested version, but does not exist at the
     4# version of the module that is already required and does not exist at
     5# the version that would be selected by 'go mod tidy', then
     6# 'go get foo@requested' should resolve the requested version,
     7# not error out on the (unrelated) latest one.
     8
     9go get example.net/a/p@v0.2.0
    10
    11-- go.mod --
    12module example
    13
    14go 1.15
    15
    16require example.net/a v0.1.0
    17
    18replace (
    19	example.net/a v0.1.0 => ./a1
    20	example.net/a v0.2.0 => ./a2
    21	example.net/a v0.3.0 => ./a1
    22)
    23
    24-- a1/go.mod --
    25module example.net/a
    26
    27go 1.15
    28-- a1/README --
    29package example.net/a/p does not exist at this version.
    30
    31-- a2/go.mod --
    32module example.net/a
    33
    34go 1.15
    35-- a2/p/p.go --
    36// Package p exists only at v0.2.0.
    37package p

View as plain text