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

fix: enable nilerr linter and fix iferr checks #2009

Merged
merged 1 commit into from
Sep 8, 2021
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 @@ -57,6 +57,7 @@ linters:
# - ineffassign
# - misspell
# - nakedret
- nilerr
# - scopelint
- staticcheck
- structcheck
Expand Down
4 changes: 2 additions & 2 deletions alter_configs_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ func (a *AlterConfigsResourceResponse) encode(pe packetEncoder) error {
pe.putInt16(a.ErrorCode)
err := pe.putString(a.ErrorMsg)
if err != nil {
return nil
return err
}
pe.putInt8(int8(a.Type))
err = pe.putString(a.Name)
if err != nil {
return nil
return err
}
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions describe_configs_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,19 +308,19 @@ func (c *ConfigSynonym) encode(pe packetEncoder, version int16) (err error) {
func (c *ConfigSynonym) decode(pd packetDecoder, version int16) error {
name, err := pd.getString()
if err != nil {
return nil
return err
}
c.ConfigName = name

value, err := pd.getString()
if err != nil {
return nil
return err
}
c.ConfigValue = value

source, err := pd.getInt8()
if err != nil {
return nil
return err
}
c.Source = ConfigSource(source)
return nil
Expand Down
2 changes: 1 addition & 1 deletion logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "testing"
// logs of the given T passed from Test functions.
// and records the text in the error log.
//
// nolint

type testLogger struct {
t *testing.T
}
Expand Down