Skip to content

Enable "nilnil" linter in golangci-lint #2360

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

Open
tuminoid opened this issue Mar 26, 2025 · 4 comments
Open

Enable "nilnil" linter in golangci-lint #2360

tuminoid opened this issue Mar 26, 2025 · 4 comments
Labels
triage/accepted Indicates an issue is ready to be actively worked on.

Comments

@tuminoid
Copy link
Member

Enable "nilnil" linter in golangci-lint. Fix any warnings enabling it causes.

/area ci
/help
/triage accepted

@metal3-io-bot metal3-io-bot added triage/accepted Indicates an issue is ready to be actively worked on. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Mar 26, 2025
@metal3-io-bot
Copy link
Contributor

@tuminoid: The label(s) area/ci cannot be applied, because the repository doesn't have them.

In response to this:

Enable "nilnil" linter in golangci-lint. Fix any warnings enabling it causes.

/area ci
/help
/triage accepted

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@andriisoldatenko
Copy link
Contributor

this one a bit tricky, it's hard to fix it without project experience :(

I only can enable linter and add //nolint:nilnil or so on those lines

INFO [runner] linters took 7.612566458s with stages: goanalysis_metalinter: 7.597061583s
controllers/metal3.io/baremetalhost_controller.go:713:3: return both a `nil` error and an invalid value: use a sentinel error instead (nilnil)
                return nil, nil
                ^
controllers/metal3.io/baremetalhost_controller.go:2040:4: return both a `nil` error and an invalid value: use a sentinel error instead (nilnil)
                        return nil, nil
                        ^
controllers/metal3.io/baremetalhost_controller.go:2143:3: return both a `nil` error and an invalid value: use a sentinel error instead (nilnil)
                return nil, nil
                ^
controllers/metal3.io/baremetalhost_controller.go:2156:3: return both a `nil` error and an invalid value: use a sentinel error instead (nilnil)
                return nil, nil
                ^
pkg/provisioner/ironic/ironic.go:283:2: return both a `nil` error and an invalid value: use a sentinel error instead (nilnil)
        return nil, nil

@tuminoid
Copy link
Member Author

tuminoid commented Apr 8, 2025

Thanks for checking it out @andriisoldatenko. It is a good finding that it isn't suitable for external contributors!

I'll remove the help-wanted in this case, and let's see if a maintainer picks it up.

/remove-help

@metal3-io-bot metal3-io-bot removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/accepted Indicates an issue is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

3 participants