...

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

Documentation: cmd/go/testdata/script

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

View as plain text