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
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Nokel81
Copy link

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 2, 2019
@agnivade agnivade added this to the Unplanned milestone Oct 2, 2019
@agnivade
Copy link
Contributor

agnivade commented Oct 2, 2019

@robpike

@robpike
Copy link
Contributor

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
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants