From 2f70ac19d29480c2e22bd0a9eca18a215c32db6f Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Thu, 20 Jun 2013 10:29:38 +1000 Subject: [PATCH] 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 --- src/cmd/go/doc.go | 10 +++++++--- src/cmd/go/help.go | 2 ++ src/cmd/go/test.go | 8 +++++--- 3 files changed, 14 insertions(+), 6 deletions(-) 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 -- 2.48.1