testing: document that "testdata" is idiomatic and special #14715
Comments
I agree that this should be greatly improved, but for the record
|
The testing package has nothing to do with it. It's a property of the go tool, which does document it. But I agree a sentence in the documentation for go test would be worthwhile. |
I prepared a CL that does exactly what @robpike proposes above, changing the output of "go help test". But rereading the original poster's request, it seems like he expected to see something in "go doc testing" (and on the web at golang.org/pkg/testing of course). So, @robpike take the CL if you want it. Or if you misspoke and what you wanted was a comment in the testing package instead, just ask and I'll do it instead. |
CL https://golang.org/cl/23353 mentions this issue. |
I must admit that I was not using |
What version of Go are you using (go version)?
go version go1.6 linux/amd64
What operating system and processor architecture are you using (go env)?
GOOS="linux"
GOARCH="amd64"
What did you do?
I read documentation at https://golang.org/pkg/testing/.
What did you expect to see?
I expected easy to find documentation about writing a test which manipulates a file.
What did you see instead?
Instead I had difficulty discovering that I can use
".", "_", "testdata"
(source). I don't know which one is the most idomatic.The text was updated successfully, but these errors were encountered: