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

New rule: testable examples must have an output comment #1309

Closed
jamietanna opened this issue Aug 9, 2022 · 1 comment
Closed

New rule: testable examples must have an output comment #1309

jamietanna opened this issue Aug 9, 2022 · 1 comment

Comments

@jamietanna
Copy link

As highlighted in golangci/golangci-lint#3084, this would be a handy rule to have, allowing us to flag incorrectly set up testable examples.

@jamietanna jamietanna added the needs-triage Newly filed issue that needs triage label Aug 9, 2022
@dominikh
Copy link
Owner

Not all examples are meant to be run during testing. People write examples that only exist to be shown as part of documentation. See for example the various examples in https://pkg.go.dev/net/http#pkg-examples. Therefore this is not a rule suitable for Staticcheck.

@dominikh dominikh closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2022
@dominikh dominikh added new-check and removed needs-triage Newly filed issue that needs triage labels Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants