]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: document that "main" is a reserved import path
authorRob Pike <r@golang.org>
Mon, 16 Sep 2013 12:53:12 +0000 (22:53 +1000)
committerRob Pike <r@golang.org>
Mon, 16 Sep 2013 12:53:12 +0000 (22:53 +1000)
Fixes #6312.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/13391049

src/cmd/go/doc.go
src/cmd/go/help.go

index 7af623ae1bb34a300143dbf2ebcae242f86f06e3..46905c1cf996d292dde9661013144eab2078a04a 100644 (file)
@@ -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
index c1aa32a539e942b54bb13236539740103e2730ff..8028fe8a9e326a3196c353491ce3be50b083404f 100644 (file)
@@ -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