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

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


env GO111MODULE=on
[!symlink] skip

# 'go list' should resolve modules of imported packages.
go list -deps -f '{{.Module}}' .
stdout golang.org/x/text

go list -deps -f '{{.Module}}' ./subpkg
stdout golang.org/x/text

# Create a copy of the module using symlinks in src/links.
mkdir links
symlink links/go.mod -> $GOPATH/src/go.mod
symlink links/issue.go -> $GOPATH/src/issue.go
mkdir links/subpkg
symlink links/subpkg/issue.go -> $GOPATH/src/subpkg/issue.go

# We should see the copy as a valid module root.
cd links
go env GOMOD
stdout links[/\\]go.mod
go list -m
stdout golang.org/issue/28107

# The symlink-based copy should contain the same packages
# and have the same dependencies as the original.
go list -deps -f '{{.Module}}' .
stdout golang.org/x/text
go list -deps -f '{{.Module}}' ./subpkg
stdout golang.org/x/text

-- go.mod --
module golang.org/issue/28107

-- issue.go --
package issue

import _ "golang.org/x/text/language"
-- subpkg/issue.go --
package issue

import _ "golang.org/x/text/language"

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.