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

     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  
    13  go mod tidy
    14  
    15  go list -m all
    16  stdout '^example.com/split-incompatible/subpkg v0\.1\.0$'
    17  ! stdout '^example.com/split-incompatible .*'
    18  
    19  -- go.mod --
    20  module golang.org/issue/41113
    21  
    22  go 1.16
    23  
    24  require example.com/split-incompatible v2.1.0-pre+incompatible
    25  -- x.go --
    26  package issue41113
    27  
    28  import _ "example.com/split-incompatible/subpkg"
    29  

View as plain text