From: Andrew Gerrand Date: Thu, 20 Jun 2013 00:29:38 +0000 (+1000) Subject: cmd/go: document that files beginning with . or _ are ignored X-Git-Tag: go1.2rc2~1215 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2f70ac19d29480c2e22bd0a9eca18a215c32db6f;p=gostls13.git cmd/go: document that files beginning with . or _ are ignored Fixes #5655. R=golang-dev, minux.ma, r CC=golang-dev https://golang.org/cl/10410045 --- diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go index f4269a8717..0a2e4826c7 100644 --- a/src/cmd/go/doc.go +++ b/src/cmd/go/doc.go @@ -396,9 +396,11 @@ It prints a summary of the test results in the format: followed by detailed output for each failed package. -'Go test' recompiles each package along with any files with names ending in -"_test.go". These additional files can contain test functions, -benchmark functions, and example functions. See 'go help testfunc' for more. +'Go test' recompiles each package along with any files with names matching +the file pattern "*_test.go". +Files whose names begin with "_" (including "_test.go") or "." are ignored. +These additional files can contain test functions, benchmark functions, and +example functions. See 'go help testfunc' for more. Each listed package causes the execution of a separate test binary. Test files that declare a package with the suffix "_test" will be compiled as a @@ -584,6 +586,8 @@ single directory, the command is applied to a single synthesized package made up of exactly those files, ignoring any build constraints in those files and ignoring any other files in the directory. +File names that begin with "." or "_" are ignored by the go tool. + Remote import path syntax diff --git a/src/cmd/go/help.go b/src/cmd/go/help.go index c70a25fdd7..c1aa32a539 100644 --- a/src/cmd/go/help.go +++ b/src/cmd/go/help.go @@ -53,6 +53,8 @@ As a special case, if the package list is a list of .go files from a single directory, the command is applied to a single synthesized package made up of exactly those files, ignoring any build constraints in those files and ignoring any other files in the directory. + +File names that begin with "." or "_" are ignored by the go tool. `, } diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index c06fe378b4..2e23526530 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -45,9 +45,11 @@ It prints a summary of the test results in the format: followed by detailed output for each failed package. -'Go test' recompiles each package along with any files with names ending in -"_test.go". These additional files can contain test functions, -benchmark functions, and example functions. See 'go help testfunc' for more. +'Go test' recompiles each package along with any files with names matching +the file pattern "*_test.go". +Files whose names begin with "_" (including "_test.go") or "." are ignored. +These additional files can contain test functions, benchmark functions, and +example functions. See 'go help testfunc' for more. Each listed package causes the execution of a separate test binary. Test files that declare a package with the suffix "_test" will be compiled as a