Skip to content
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

Enable nilnesserr linter #5547

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ linters:
- gofmt # Checks whether code was gofmt-ed
- goheader # Checks is file headers matche a given pattern
- intrange # Checking for loops that could use an integer range
- nilnesserr # Reports constructs that check for err != nil but return a different nil value error
- nolintlint # Find ill-formed or insufficiently explained nolint directives
- nosprintfhostport # Detects misuses of Sprintf to construct hosts with ports in a URL
- perfsprint # Checks for faster fmt.Sprintf alternatives
Expand Down
6 changes: 3 additions & 3 deletions pkg/token/joindecode.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func DecodeJoinToken(token string) ([]byte, error) {

var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
gzErr := gz.Close()
closeErr := gz.Close()
if err != nil {
return nil, err
}
if gzErr != nil {
return nil, err
if closeErr != nil {
return nil, closeErr
}

return buf.Bytes(), nil
Expand Down
Loading