...

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

Documentation: cmd/go/testdata/script

     1# Regression test for https://golang.org/issue/41113.
     2#
     3# When resolving a missing import path, the inability to add the package from
     4# one module path should not interfere with adding a nested path.
     5
     6# Initially, our module depends on split-incompatible v2.1.0-pre+incompatible,
     7# from which an imported package has been removed (and relocated to the nested
     8# split-incompatible/subpkg module). modload.QueryPattern will suggest
     9# split-incompatible v2.0.0+incompatible, which we cannot use (because it would
    10# be an implicit downgrade), and split-incompatible/subpkg v0.1.0, which we
    11# *should* use.
    12
    13go mod tidy
    14
    15go list -m all
    16stdout '^example.com/split-incompatible/subpkg v0\.1\.0$'
    17! stdout '^example.com/split-incompatible .*'
    18
    19-- go.mod --
    20module golang.org/issue/41113
    21
    22go 1.16
    23
    24require example.com/split-incompatible v2.1.0-pre+incompatible
    25-- x.go --
    26package issue41113
    27
    28import _ "example.com/split-incompatible/subpkg"

View as plain text