Skip to content
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

cmd/go: the fact that go build/install ignores _test.go files is not documented #15315

Closed
kostya-sh opened this issue Apr 15, 2016 · 1 comment

Comments

@kostya-sh
Copy link
Contributor

The documentation (both for 1.6 at https://golang.org/cmd/go/ and for tip at https://tip.golang.org/cmd/go/) for go test says that

'Go test' recompiles each package along with any files with names matching the file pattern "*_test.go".

However the documentation for go build doesn't say anything about _test.go files.

I think the documentation for go build and go install should be updated to mention that _test.go files are ignored.

While most users probably do not read the documentation carefully it is still useful to have something to refer new users to. See the following StackOverflow question for background: http://stackoverflow.com/questions/36638149/undefined-variables-within-a-package-during-build

@bradfitz bradfitz added this to the Go1.7 milestone Apr 15, 2016
@gopherbot
Copy link

CL https://golang.org/cl/22180 mentions this issue.

@golang golang locked and limited conversation to collaborators Apr 18, 2017
@rsc rsc unassigned adg Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants