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

refactor: enable ineffassign and wastedassign linters #289

Closed
wants to merge 2 commits into from
Closed
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
4 changes: 2 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ linters:
- grouper
- importas
# - inamedparam
# - ineffassign
- ineffassign
- interfacebloat
# - intrange
- loggercheck
Expand Down Expand Up @@ -86,7 +86,7 @@ linters:
# - unparam
# - unused
# - usestdlibvars
# - wastedassign
- wastedassign
- whitespace
- zerologlint
disable-all: true
2 changes: 1 addition & 1 deletion binary/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func typeForPath(filePath string) (*fileType, error) {
}
}

isBinProto := false
var isBinProto bool
switch ext {
case ".binproto":
isBinProto = true
Expand Down
4 changes: 2 additions & 2 deletions extractor/filesystem/os/rpm/rpm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func TestFileRequired(t *testing.T) {
wantResultMetric = stats.FileRequiredResultOK
}
gotResultMetric := collector.FileRequiredResult(tt.path)
if tt.wantResultMetric != "" && gotResultMetric != tt.wantResultMetric {
t.Errorf("FileRequired(%s) recorded result metric %v, want result metric %v", tt.path, gotResultMetric, tt.wantResultMetric)
if wantResultMetric != "" && gotResultMetric != wantResultMetric {
t.Errorf("FileRequired(%s) recorded result metric %v, want result metric %v", tt.path, gotResultMetric, wantResultMetric)
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func (e *Extractor) Extract(ctx context.Context, input *standalone.ScanInput) ([
// and reset it in the extractor.
cli, err := containerd.New(e.socketAddr)
if err != nil {
cli = nil
log.Errorf("Failed to connect to containerd socket %v, error: %v", e.socketAddr, err)
return inventory, err
}
Expand Down
Loading