-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testing: document how to place tests in a _test package #5144
Labels
Milestone
Comments
> Does the package name need to end in _test? It seems so, since otherwise go build and go test complain about multiple packages in the directory. Yes. It's actually codified in cmd/go/test.go +420, and doc.go +343. These fields are can be inspected by go list, lucky(~) % go list -f '{{ .TestGoFiles }}' bytes [export_test.go] lucky(~) % go list -f '{{ .XTestGoFiles }}' bytes [buffer_test.go bytes_test.go example_test.go reader_test.go] But you are correct that package $PKG_test is special. > Any other subtleties I should be aware of? Watch out for the duplication test.go has a description of the command which is part of the go help output, but doc.go has the godoc string, those two need to be kept in sync. Status changed to Accepted. |
This issue was closed by revision 091970c. Status changed to Fixed. |
kisielk
added
fixed
Suggested
Issues that may be good for new contributors looking for work to do.
labels
Apr 8, 2013
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
The text was updated successfully, but these errors were encountered: