]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/{run,work,generate}: document file path location requirement
authorAgniva De Sarker <agnivade@yahoo.co.in>
Thu, 15 Nov 2018 18:05:27 +0000 (23:35 +0530)
committerAgniva De Sarker <agniva.quicksilver@gmail.com>
Wed, 27 Mar 2019 03:41:10 +0000 (03:41 +0000)
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 <dmitshur@golang.org>
src/cmd/go/alldocs.go
src/cmd/go/internal/generate/generate.go
src/cmd/go/internal/run/run.go
src/cmd/go/internal/work/build.go

index 5b62ed939c8364cdf73bb43bc0d976ce3ec2a995..8dd3f8eb18b6a507514ebafa9131b4df98d6d417 100644 (file)
@@ -74,8 +74,8 @@
 // Build compiles the packages named by the import paths,
 // along with their dependencies, but it does not install the results.
 //
-// If the arguments to build are a list of .go files, build treats
-// them as a list of source files specifying a single package.
+// If the arguments to build are a list of .go files from a single directory,
+// build treats them as a list of source files specifying a single package.
 //
 // When compiling a single main package, build writes
 // the resulting executable to an output file named after
 // "go tool foo".
 //
 // Generate processes packages in the order given on the command line,
-// one at a time. If the command line lists .go files, they are treated
-// as a single package. Within a package, generate processes the
+// one at a time. If the command line lists .go files from a single directory,
+// they are treated as a single package. Within a package, generate processes the
 // source files in a package in file name order, one at a time. Within
 // a source file, generate runs generators in the order they appear
 // in the file, one at a time.
 //     go run [build flags] [-exec xprog] package [arguments...]
 //
 // Run compiles and runs the named main Go package.
-// Typically the package is specified as a list of .go source files,
+// Typically the package is specified as a list of .go source files from a single directory,
 // but it may also be an import path, file system path, or pattern
 // matching a single known package, as in 'go run .' or 'go run my/cmd'.
 //
index 23e2ecc224e5b30eb0b054ee89312f503f763c01..38c8274b401306302878816e6346e405409a4128 100644 (file)
@@ -110,8 +110,8 @@ specifies that the command "foo" represents the generator
 "go tool foo".
 
 Generate processes packages in the order given on the command line,
-one at a time. If the command line lists .go files, they are treated
-as a single package. Within a package, generate processes the
+one at a time. If the command line lists .go files from a single directory,
+they are treated as a single package. Within a package, generate processes the
 source files in a package in file name order, one at a time. Within
 a source file, generate runs generators in the order they appear
 in the file, one at a time.
index feccf23b2782a868fbf822be029935a959d765ff..8b3006bf2c26060f78f3f2ad363585e7cef55cef 100644 (file)
@@ -22,7 +22,7 @@ var CmdRun = &base.Command{
        Short:     "compile and run Go program",
        Long: `
 Run compiles and runs the named main Go package.
-Typically the package is specified as a list of .go source files,
+Typically the package is specified as a list of .go source files from a single directory,
 but it may also be an import path, file system path, or pattern
 matching a single known package, as in 'go run .' or 'go run my/cmd'.
 
index eac027e09ee7bcc38e39a6ba4b5833bdef0909c3..96b37444447f535787785210391f5762dc0bfa20 100644 (file)
@@ -27,8 +27,8 @@ var CmdBuild = &base.Command{
 Build compiles the packages named by the import paths,
 along with their dependencies, but it does not install the results.
 
-If the arguments to build are a list of .go files, build treats
-them as a list of source files specifying a single package.
+If the arguments to build are a list of .go files from a single directory,
+build treats them as a list of source files specifying a single package.
 
 When compiling a single main package, build writes
 the resulting executable to an output file named after