-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ci: address multiple lint rules #2869
Conversation
Tagalign requires awkward manual formatting and doesn't provide much value for readability.
mirror warns against certain cases of useless conversion between string and []byte.
This linter encourages replacing several functions from the fmt package with faster alternatives. While fixing issues, I also added a few exported error types rather than returning a naked errors.New().
Here's an example of what tagalign will enforce: type Request struct {
QueryParam string `query:"query_param"`
HeaderParam string `header:"header_param"`
BodyParam string `form:"body_param" json:"body_param" xml:"body_param"`
} ^ it will complain if you don't have this exact number of spaces between the form and json tags for BodyParam. |
60a8f22
to
d5f150f
Compare
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.
Unfortunately, go fmt
won’t automatically align the tags, which makes it an annoying manual task. LGTM!
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.
LGTM, i'm fine with disabling tagalign
Description
Disable tagalign.
Tagalign requires awkward manual formatting and doesn't provide much value for readability.
Enable mirror.
Mirror warns against certain cases of useless conversion between string and []byte.
Enable perfsprint.
This linter encourages replacing several functions from the fmt package with faster alternatives. While fixing issues, I added a few exported error types rather than returning a naked errors.New().
Type of Change
Checklist
Before you submit your pull request, please make sure you meet these requirements: