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/cover: comment to ignore files for coverage #34639

Open
Nokel81 opened this issue Oct 1, 2019 · 2 comments
Open

cmd/cover: comment to ignore files for coverage #34639

Nokel81 opened this issue Oct 1, 2019 · 2 comments

Comments

@Nokel81
Copy link

@Nokel81 Nokel81 commented Oct 1, 2019

For some classifications of generated code it is a necessity to have the output file be in the same folder and package as the source go file (for instance generating methods on types in the source files).

However, this means that the generated code is counted when doing coverage. Which is sometimes undesirable since it is there but you don't test the whole thing.

@smasher164 smasher164 changed the title Improvement: comment to ignore files for coverage cmd/cover: comment to ignore files for coverage Oct 1, 2019
@agnivade agnivade added this to the Unplanned milestone Oct 2, 2019
@agnivade
Copy link
Contributor

@agnivade agnivade commented Oct 2, 2019

@robpike
Copy link
Contributor

@robpike robpike commented Oct 2, 2019

I don't think the issue is worth decorating the source code. In general I discourage tools that require annotations. Sometimes (such as with go generate) they are pretty much necessary, but this request is just for an option to control a non-critical build tool, and that is below the bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.