Plan 9 from Bell Labs’s /usr/web/sources/contrib/stallion/root/386/go/src/cmd/go/testdata/script/mod_init_dep.txt

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


env GO111MODULE=on

# modconv uses git directly to examine what old 'go get' would
[!net] skip
[!exec:git] skip

# go build should populate go.mod from Gopkg.lock
cp go.mod1 go.mod
go build
stderr 'copying requirements from Gopkg.lock'
go list -m all
! stderr 'copying requirements from Gopkg.lock'
stdout 'rsc.io/sampler v1.0.0'

# go list should populate go.mod from Gopkg.lock
cp go.mod1 go.mod
go list
stderr 'copying requirements from Gopkg.lock'
go list
! stderr 'copying requirements from Gopkg.lock'
go list -m all
stdout 'rsc.io/sampler v1.0.0'

# test dep replacement
cd y
go mod init
cmpenv go.mod go.mod.replace

-- go.mod1 --
module x

-- x.go --
package x

-- Gopkg.lock --
[[projects]]
  name = "rsc.io/sampler"
  version = "v1.0.0"

-- y/Gopkg.lock --
[[projects]]
  name = "z"
  revision = "v1.0.0"
  source = "rsc.io/quote"

-- y/y.go --
package y // import "y"
import _ "z"

-- y/go.mod.replace --
module y

go $goversion

replace z v1.0.0 => rsc.io/quote v1.0.0

require rsc.io/quote v1.0.0

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.