Skip to content

Commit

Permalink
cmd/go: document that "main" is a reserved import path
Browse files Browse the repository at this point in the history
Fixes #6312.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/13391049
  • Loading branch information
robpike committed Sep 16, 2013
1 parent ab578e1 commit 29b4de2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
15 changes: 10 additions & 5 deletions src/cmd/go/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions src/cmd/go/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 29b4de2

Please sign in to comment.