-
Notifications
You must be signed in to change notification settings - Fork 885
chore: Linter rule for properly formatted api errors #2123
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
Conversation
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.
This is awesome! One minor nit that I noticed, detail
doesn't currently contain omitempty
. Is that intended?
@@ -123,6 +123,7 @@ func New(options *Options) *API { | |||
) | |||
r.Get("/", func(w http.ResponseWriter, r *http.Request) { | |||
httpapi.Write(w, http.StatusOK, httpapi.Response{ | |||
//nolint:gocritic |
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.
That's a good linter 🕵️🕵️🕵️
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.
The only message I needed to make an exception for 😄
not a bad idea to add it. Adding it now 👍 |
* chore: Linter rule for properly formatted api errors * Add omitempty to 'Detail' field
All
Message
fields must be proper sentences.