-
Notifications
You must be signed in to change notification settings - Fork 465
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
Brushes off some lint #452
Conversation
* Resolves most go staticcheck errors. * Replaces a few deprecated packages / functions. * Makes some minor changes to error responses on the /json endpoint. Signed-off-by: Charlie Crawford <ccrawford@pagerduty.com>
@envoyproxy/ratelimit-maintainers in the event you are just really bored and looking for something to do 😉 |
Very nice. Just to confirm so these lints were all detected via tooling and safe to update, correct? |
That is correct. Everything I changed was detected by go staticcheck. The only functional change here is very minor changes to the error responses of the |
logger.Warnf("error: %s", err.Error()) | ||
http.Error(writer, err.Error(), http.StatusBadRequest) |
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.
Any particular reason we're removing the more descriptive error msgs in the responses? Is it for consistency, security?
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.
Ah my apologies! I have updated the PR description to provide more clarity around why I made these overall changes here.
In this exact line you commented on we are still doing the same thing; I just refactored it into a shared function for consistency.
* Resolves most go staticcheck errors. * Replaces a few deprecated packages / functions. * Makes some minor changes to error responses on the /json endpoint. Signed-off-by: Charlie Crawford <ccrawford@pagerduty.com>
Overview
/json
API endpoint (see the tests intest/server/server_impl_test.go
for more detail).Commentary
this
is used all over the place./json
API endpoint were motivated by: