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

     1  # Conflicting workspace module replaces can be overridden by a replace in the
     2  # go.work file.
     3  
     4  go list -m example.com/dep
     5  stdout 'example.com/dep v1.0.0 => ./dep3'
     6  
     7  -- go.work --
     8  use m
     9  use n
    10  replace example.com/dep => ./dep3
    11  -- m/go.mod --
    12  module example.com/m
    13  
    14  require example.com/dep v1.0.0
    15  replace example.com/dep => ./dep1
    16  -- m/m.go --
    17  package m
    18  
    19  import "example.com/dep"
    20  
    21  func F() {
    22  	dep.G()
    23  }
    24  -- n/go.mod --
    25  module example.com/n
    26  
    27  require example.com/dep v1.0.0
    28  replace example.com/dep => ./dep2
    29  -- n/n.go --
    30  package n
    31  
    32  import "example.com/dep"
    33  
    34  func F() {
    35  	dep.G()
    36  }
    37  -- dep1/go.mod --
    38  module example.com/dep
    39  -- dep1/dep.go --
    40  package dep
    41  
    42  func G() {
    43  }
    44  -- dep2/go.mod --
    45  module example.com/dep
    46  -- dep2/dep.go --
    47  package dep
    48  
    49  func G() {
    50  }
    51  -- dep3/go.mod --
    52  module example.com/dep
    53  -- dep3/dep.go --
    54  package dep
    55  
    56  func G() {
    57  }
    58  

View as plain text