github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/mod_replace_gopkgin.txt (about)

     1  # Regression test for golang.org/issue/34254:
     2  # a clone of gopkg.in/[…].vN should be replaceable by
     3  # a fork hosted at corp.example.com/[…]/vN,
     4  # even if there is an explicit go.mod file containing the
     5  # gopkg.in path.
     6  
     7  [short] skip
     8  [!net] skip
     9  [!exec:git] skip
    10  
    11  env GO111MODULE=on
    12  env GOPROXY=direct
    13  env GOSUMDB=off
    14  
    15  # Replacing gopkg.in/[…].vN with a repository with a root go.mod file
    16  # specifying […].vN and a compatible version should succeed, even if
    17  # the replacement path is not a gopkg.in path.
    18  cd 4-to-4
    19  go list -m gopkg.in/src-d/go-git.v4
    20  
    21  # Previous versions of the "go" command accepted v0 and v1 pseudo-versions
    22  # as replacements for gopkg.in/[…].v4.
    23  # As a special case, we continue to accept those.
    24  
    25  cd ../4-to-0
    26  go list -m gopkg.in/src-d/go-git.v4
    27  
    28  cd ../4-to-1
    29  go list -m gopkg.in/src-d/go-git.v4
    30  
    31  cd ../4-to-incompatible
    32  go list -m gopkg.in/src-d/go-git.v4
    33  
    34  # A mismatched gopkg.in path should not be able to replace a different major version.
    35  cd ../3-to-gomod-4
    36  ! go list -m gopkg.in/src-d/go-git.v3
    37  stderr '^go: gopkg\.in/src-d/go-git\.v3@v3.0.0-20190801152248-0d1a009cbb60: invalid version: go\.mod has non-\.\.\.\.v3 module path "gopkg\.in/src-d/go-git\.v4" at revision 0d1a009cbb60$'
    38  
    39  -- 4-to-4/go.mod --
    40  module golang.org/issue/34254
    41  
    42  go 1.13
    43  
    44  require gopkg.in/src-d/go-git.v4 v4.13.1
    45  
    46  replace gopkg.in/src-d/go-git.v4 v4.13.1 => github.com/src-d/go-git/v4 v4.13.1
    47  -- 4-to-1/go.mod --
    48  module golang.org/issue/34254
    49  
    50  go 1.13
    51  
    52  require gopkg.in/src-d/go-git.v4 v4.13.1
    53  
    54  replace gopkg.in/src-d/go-git.v4 v4.13.1 => github.com/src-d/go-git v1.0.1-0.20190801152248-0d1a009cbb60
    55  -- 4-to-0/go.mod --
    56  module golang.org/issue/34254
    57  
    58  go 1.13
    59  
    60  require gopkg.in/src-d/go-git.v4 v4.13.1
    61  
    62  replace gopkg.in/src-d/go-git.v4 v4.13.1 => github.com/src-d/go-git v0.0.0-20190801152248-0d1a009cbb60
    63  -- 4-to-incompatible/go.mod --
    64  module golang.org/issue/34254
    65  
    66  go 1.13
    67  
    68  require gopkg.in/src-d/go-git.v4 v4.13.1
    69  
    70  replace gopkg.in/src-d/go-git.v4 v4.13.1 => github.com/src-d/go-git v4.6.0+incompatible
    71  -- 3-to-gomod-4/go.mod --
    72  module golang.org/issue/34254
    73  go 1.13
    74  
    75  require gopkg.in/src-d/go-git.v3 v3.2.0
    76  
    77  // This replacement has a go.mod file declaring its path to be
    78  // gopkg.in/src-d/go-git.v4, so it cannot be used as a replacement for v3.
    79  replace gopkg.in/src-d/go-git.v3 v3.2.0 => gopkg.in/src-d/go-git.v3 v3.0.0-20190801152248-0d1a009cbb60