diff options
author | Rob Pike <r@golang.org> | 2013-09-16 22:53:12 +1000 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2013-09-16 22:53:12 +1000 |
commit | 8c15171d1581eca20128eb03a09e64050d4dcb16 (patch) | |
tree | 2a7f05c5d94d9d4d5a46bd78cedcb796800b6f28 /src | |
parent | 41787749f4339c0de614686c907bae7e2d03c2c6 (diff) | |
download | go-8c15171d1581eca20128eb03a09e64050d4dcb16.tar.gz |
cmd/go: document that "main" is a reserved import path
Fixes issue 6312.
R=golang-dev, dave
CC=golang-dev
https://codereview.appspot.com/13391049
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/go/doc.go | 15 | ||||
-rw-r--r-- | src/cmd/go/help.go | 15 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go index 7af623ae1..46905c1cf 100644 --- a/src/cmd/go/doc.go +++ b/src/cmd/go/doc.go @@ -542,12 +542,17 @@ environment variable (see 'go help gopath'). If no import paths are given, the action applies to the package in the current directory. -The special import path "all" expands to all package directories -found in all the GOPATH trees. For example, 'go list all' -lists all the packages on the local system. +There are three reserved names for paths that should not be used +for packages to be built with the go tool: -The special import path "std" is like all but expands to just the -packages in the standard Go library. +- "main" denotes the top-level package in a stand-alone executable. + +- "all" expands to all package directories found in all the GOPATH +trees. For example, 'go list all' lists all the packages on the local +system. + +- "std" is like all but expands to just the packages in the standard +Go library. An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and diff --git a/src/cmd/go/help.go b/src/cmd/go/help.go index c1aa32a53..8028fe8a9 100644 --- a/src/cmd/go/help.go +++ b/src/cmd/go/help.go @@ -25,12 +25,17 @@ environment variable (see 'go help gopath'). If no import paths are given, the action applies to the package in the current directory. -The special import path "all" expands to all package directories -found in all the GOPATH trees. For example, 'go list all' -lists all the packages on the local system. +There are three reserved names for paths that should not be used +for packages to be built with the go tool: -The special import path "std" is like all but expands to just the -packages in the standard Go library. +- "main" denotes the top-level package in a stand-alone executable. + +- "all" expands to all package directories found in all the GOPATH +trees. For example, 'go list all' lists all the packages on the local +system. + +- "std" is like all but expands to just the packages in the standard +Go library. An import path is a pattern if it includes one or more "..." wildcards, each of which can match any string, including the empty string and |