"go help test" says...
>'Go test' recompiles each package along with any files with names matching
>the file pattern "*_test.go".
>You write a test by creating a file with a name ending in _test.go
However, if the filename is just _test.go it won't run that. This is unfortunate,
because if I have a directory full of *.go files making up a package, having the tests
in _test.go would be set apart visually in the directory listing.
I think the documentation is correct and the "testing" package is wrong.
Which version are you using? (run 'go version') Observed in both "go1.0.3
(appengine-1.8.0)" and "version go1.1 darwin/amd64"
The text was updated successfully, but these errors were encountered:
Excuse me?! If I read the diffs correctly, you just changed the docs to say “ends
with _test.go”. Well, the filename _test.go also ends with “_test.go”, so this
fix is a no-op.
If you’re determined to just change the documentation you have to sa y “ends with
_test.go but with one or more characters preceding the _” Which, if I were writing
it, would make me ask “why does this artificial restriction exist?”
You're right, this is a non-fix.
I've dug into it. We don't explicitly ignore files named "_test.go", but the build
infrastructure does explicitly ignore any file that begins with a dot or an underscore.
So the docs are technically correct by omission. :P
So, the cmd/go docs need to be updated to mention that files beginning with . and _ are
The go/build package docs do mention it, though: