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

     1  # If a replacement module declares a module path different from both
     2  # the original module and its location, report an error with all three paths.
     3  # In particular, the "required as" path should be the original.
     4  # Verifies golang.org/issue/38220.
     5  ! go mod download
     6  cmp stderr want
     7  
     8  -- go.mod --
     9  module m
    10  
    11  require rsc.io/quote v1.5.2
    12  
    13  replace rsc.io/quote v1.5.2 => example.com/quote v1.5.2
    14  
    15  -- use.go --
    16  package use
    17  
    18  import _ "rsc.io/quote"
    19  
    20  -- want --
    21  go: rsc.io/quote@v1.5.2 (replaced by example.com/quote@v1.5.2): parsing go.mod:
    22  	module declares its path as: rsc.io/Quote
    23  	        but was required as: rsc.io/quote
    24  

View as plain text