You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
testing: document that "testdata" is idiomatic and special #14715
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 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.
Activity
[-]Documentation: Test resources[/-][+]testing: document that "testdata" is idiomatic and special[/+]bradfitz commentedon Mar 8, 2016
/cc @adg @robpike for thoughts
cespare commentedon Mar 8, 2016
I agree that this should be greatly improved, but for the record
go help packagesstates (at the very end):robpike commentedon Apr 4, 2016
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.
jeffallen commentedon May 24, 2016
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.
gopherbot commentedon May 24, 2016
CL https://golang.org/cl/23353 mentions this issue.
molivier commentedon May 24, 2016
I must admit that I was not using
go help packagecommand. Thanks to your comments and this CL it is much clearer.Unit test with Chinook database
Move chinook package to idiomatic testdata dir
Use idiomatic 'testdata' directory name