Skip to content

Commit 08ba9c0

Browse files
committed
cmd/go/internal/{run,work,generate}: document file path location requirement
Mention that .go files must be from a single directory for them to be treated as a single package. Fixes #21529 Change-Id: I79cb08b9f43888814b1249a7b50bc7bc70bc1c72 Reviewed-on: https://go-review.googlesource.com/c/go/+/149797 Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 724a86f commit 08ba9c0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/cmd/go/alldocs.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/generate/generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ specifies that the command "foo" represents the generator
110110
"go tool foo".
111111
112112
Generate processes packages in the order given on the command line,
113-
one at a time. If the command line lists .go files, they are treated
114-
as a single package. Within a package, generate processes the
113+
one at a time. If the command line lists .go files from a single directory,
114+
they are treated as a single package. Within a package, generate processes the
115115
source files in a package in file name order, one at a time. Within
116116
a source file, generate runs generators in the order they appear
117117
in the file, one at a time.

src/cmd/go/internal/run/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var CmdRun = &base.Command{
2222
Short: "compile and run Go program",
2323
Long: `
2424
Run compiles and runs the named main Go package.
25-
Typically the package is specified as a list of .go source files,
25+
Typically the package is specified as a list of .go source files from a single directory,
2626
but it may also be an import path, file system path, or pattern
2727
matching a single known package, as in 'go run .' or 'go run my/cmd'.
2828

src/cmd/go/internal/work/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ var CmdBuild = &base.Command{
2727
Build compiles the packages named by the import paths,
2828
along with their dependencies, but it does not install the results.
2929
30-
If the arguments to build are a list of .go files, build treats
31-
them as a list of source files specifying a single package.
30+
If the arguments to build are a list of .go files from a single directory,
31+
build treats them as a list of source files specifying a single package.
3232
3333
When compiling a single main package, build writes
3434
the resulting executable to an output file named after

0 commit comments

Comments
 (0)