-
Notifications
You must be signed in to change notification settings - Fork 626
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
Minor cleanup #3292
Minor cleanup #3292
Conversation
@@ -10,7 +10,7 @@ linters: | |||
- govet | |||
- ineffassign | |||
- misspell | |||
# - nakedret | |||
- nakedret |
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.
What is the benefit?
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.
It is a matter of choice, and deciding if we want to allow naked returns or not.
I (clearly) think we should not.
Naked returns IMHO are a very contentious language feature (golang/go#21291 ).
They make code harder to read and understand, more confusing to newcomers (have to look back to the function signature to figure out what is being returned), and they are likely error prone, for example when err gets shadowed (named returns are already problematic in that regard when used with defer).
We only had two in the codebase.
Adding the linter will ensure we won't get any in the future.
WDYT?
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
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.
Thanks
A handful of maintenance changes
http.ErrSchemeMismatch
instead of our ad-hoc plain text parsing method now that go exposes itmapstructure
dependency (https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc) and replace it by blessed forkcontains
method and use goslices.Contains
(go 1.21)projectloader.Load
totestutil