...

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

Documentation: cmd/go/testdata/script

     1# Verifies golang.org/issue/37574.
     2
     3# If we are already using an +incompatible version, we shouldn't look up
     4# a lower compatible version when upgrading.
     5cp go.mod go.mod.orig
     6go mod tidy
     7cmp go.mod.orig go.mod
     8grep '^example.com/incompatiblewithsub v2\.0\.0\+incompatible' go.sum
     9! grep '^example.com/incompatiblewithsub v1.0.0' go.sum
    10
    11go get example.com/incompatiblewithsub/sub
    12cmp go.mod.orig go.mod
    13! grep '^example.com/incompatiblewithsub v1.0.0' go.sum
    14
    15# TODO(golang.org/issue/31580): the 'go get' command above should not change
    16# go.sum. However, as part of the query above, we download example.com@v1.0.0,
    17# an unrelated module, since it's a possible prefix. The sum for that module
    18# should not be written to go.sum.
    19
    20-- go.mod --
    21module m
    22
    23go 1.15
    24
    25require example.com/incompatiblewithsub v2.0.0+incompatible
    26-- use.go --
    27package use
    28
    29import _ "example.com/incompatiblewithsub/sub"

View as plain text