Skip to content

Commit

Permalink
Merge pull request #5547 from twz123/enable-nilnesserr
Browse files Browse the repository at this point in the history
Enable nilnesserr linter
  • Loading branch information
twz123 authored Feb 11, 2025
2 parents 974e411 + b8de298 commit 2c9efde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit 2c9efde

Please sign in to comment.