| Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64 Path : /opt/golang/1.22.0/src/cmd/go/testdata/script/ |
| Current File : //opt/golang/1.22.0/src/cmd/go/testdata/script/work_vendor_modules_txt_conditional.txt |
# This test checks to see if we only start in workspace vendor
# mode if the modules.txt specifies ## workspace (and only in
# standard vendor if it doesn't).
# vendor directory produced for workspace, workspace mode
# runs in mod=vendor
go work vendor
cmp vendor/modules.txt want_workspace_modules_txt
go list -f {{.Dir}} example.com/b
stdout $GOPATH[\\/]src[\\/]vendor[\\/]example.com[\\/]b
# vendor directory produced for workspace, module mode
# runs in mod=readonly
env GOWORK=off
go list -f {{.Dir}} example.com/b
stdout $GOPATH[\\/]src[\\/]b
# vendor directory produced for module, module mode
# runs in mod=vendor
go mod vendor
cmp vendor/modules.txt want_module_modules_txt
go list -f {{.Dir}} example.com/b
stdout $GOPATH[\\/]src[\\/]vendor[\\/]example.com[\\/]b
# vendor directory produced for module, workspace mode
# runs in mod=readonly
env GOWORK=
go list -f {{.Dir}} example.com/b
stdout $GOPATH[\\/]src[\\/]b
-- want_workspace_modules_txt --
## workspace
# example.com/b v0.0.0 => ./b
## explicit; go 1.21
example.com/b
# example.com/b => ./b
-- want_module_modules_txt --
# example.com/b v0.0.0 => ./b
## explicit; go 1.21
example.com/b
# example.com/b => ./b
-- go.work --
go 1.21
use .
-- go.mod --
module example.com/a
go 1.21
require example.com/b v0.0.0
replace example.com/b => ./b
-- a.go --
package a
import _ "example.com/b"
-- b/go.mod --
module example.com/b
go 1.21
-- b/b.go --
package b