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

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


env GO111MODULE=on

# golang.org/issue/32917 and golang.org/issue/28459: 'go build' and 'go test'
# in an empty directory should refer to the path '.' and should not attempt
# to resolve an external module.
cd dir
! go get .
stderr 'go get \.: path .* is not a package in module rooted at .*[/\\]dir$'
! go list
! stderr 'cannot find module providing package'
stderr '^can.t load package: package \.: no Go files in '$WORK'[/\\]gopath[/\\]src[/\\]dir$'

cd subdir
! go list
! stderr 'cannot find module providing package'
stderr '^can.t load package: package \.: no Go files in '$WORK'[/\\]gopath[/\\]src[/\\]dir[/\\]subdir$'
cd ..

# golang.org/issue/30590: if a package is found in the filesystem
# but is not in the main module, the error message should not say
# "cannot find module providing package", and we shouldn't try
# to find a module providing the package.
! go list ./othermodule
! stderr 'cannot find module providing package'
stderr 'go: directory othermodule is outside main module'

-- dir/go.mod --
module example.com
go 1.13
-- dir/subdir/README --
There are no Go source files in this directory.
-- dir/othermodule/go.mod --
module example.com/othermodule
go 1.13
-- dir/othermodule/om.go --
package othermodule

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.