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

     1  [short] skip
     2  
     3  go mod download example.com/printversion@v0.1.0 example.com/printversion@v1.0.0
     4  go get example.com/printversion@v0.1.0
     5  go install example.com/printversion
     6  
     7  go run example.com/printversion
     8  cmp stdout out.txt
     9  
    10  go version -m $GOPATH/bin/printversion$GOEXE
    11  stdout '^.*[/\\]bin[/\\]printversion'$GOEXE': .*$'
    12  stdout '^	path	example.com/printversion$'
    13  stdout '^	mod	example.com/printversion	v0.1.0$'
    14  stdout '^	=>	example.com/printversion	v1.0.0	h1:.*$'
    15  stdout '^	dep	example.com/version	v1.0.0$'
    16  stdout '^	=>	example.com/version	v1.0.1	h1:.*$'
    17  
    18  -- go.mod --
    19  module golang.org/issue/37392
    20  go 1.14
    21  require (
    22  	example.com/printversion v0.1.0
    23  )
    24  replace (
    25  	example.com/printversion => example.com/printversion v1.0.0
    26  	example.com/version v1.0.0 => example.com/version v1.0.1
    27  )
    28  -- out.txt --
    29  path is example.com/printversion
    30  main is example.com/printversion v0.1.0
    31  	(replaced by example.com/printversion v1.0.0)
    32  using example.com/version v1.0.0
    33  	(replaced by example.com/version v1.0.1)
    34  

View as plain text