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
xmlencoderclose: linter that checks xml.Encoder is closed #3895
base: master
Are you sure you want to change the base?
Conversation
Hey, thank you for opening your first Pull Request ! |
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements.
Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
2902af1
to
3207eb2
Compare
@@ -147,6 +148,7 @@ require ( | |||
github.com/google/go-cmp v0.5.9 // indirect | |||
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect | |||
github.com/gostaticanalysis/comment v1.4.2 // indirect | |||
github.com/gostaticanalysis/sqlrows v0.0.0-20200307153552-ea5697937269 // indirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange when the linter for XML depends on the sqlrows
package. Could we rewrite linter's code to avoid github.com/gostaticanalysis/sqlrows
dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. analysisutil.CalledFrom
has some missing cases, so I filed a bug upstream.
xmlencoderclose
is a linter which checks to make sure thatxml.Encoder
instances are closed. Without closing an Encoder it may not flush all data. Closing encoders also verifies the XML has balanced start/end tags.We've identified a need for this linter at Moov and it has found several bugs.