Skip to content

Commit a06ecf4

Browse files
Fix lint errors (errcheck, gosimple, ineffassign)
1 parent dddd18e commit a06ecf4

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

pkg/analyzer/dependencies.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func scanPyprojectToml(data []byte, path string) []DependencyFinding {
289289
}
290290

291291
func createDependencyFinding(lib CryptoLibrary, version, path string) DependencyFinding {
292-
severity := types.SeverityMedium
292+
var severity types.Severity
293293
quantum := types.QuantumVulnerable
294294
remediation := ""
295295

pkg/reporter/text.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (r *TextReporter) Generate(results *scanner.Results) (string, error) {
199199

200200
// Source code context - the key feature for verification
201201
if f.SourceContext != nil && len(f.SourceContext.Lines) > 0 {
202-
b.WriteString(fmt.Sprintf(" │\n"))
202+
b.WriteString(" │\n")
203203
b.WriteString(fmt.Sprintf(" │ %s\n", r.color(colorBold, "Source:")))
204204
b.WriteString(fmt.Sprintf(" │ %s\n", r.color(colorCyan, "┌────────────────────────────────────────────────────────")))
205205
for _, srcLine := range f.SourceContext.Lines {
@@ -220,7 +220,7 @@ func (r *TextReporter) Generate(results *scanner.Results) (string, error) {
220220
}
221221
}
222222
b.WriteString(fmt.Sprintf(" │ %s\n", r.color(colorCyan, "└────────────────────────────────────────────────────────")))
223-
b.WriteString(fmt.Sprintf(" │\n"))
223+
b.WriteString(" │\n")
224224
}
225225

226226
// Match (what pattern was detected)

pkg/scanner/scanner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ func (s *Scanner) scanDirectory(root string) error {
265265
go func() {
266266
defer wg.Done()
267267
for path := range fileChan {
268-
s.scanFile(path)
268+
_ = s.scanFile(path) // Error logged internally
269269
}
270270
}()
271271
}

pkg/scanner/scanner_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ func TestScanProgress(t *testing.T) {
492492
// Create multiple files
493493
for i := 0; i < 5; i++ {
494494
testFile := filepath.Join(tmpDir, filepath.FromSlash(filepath.Join("dir", string(rune('a'+i))+".go")))
495-
os.MkdirAll(filepath.Dir(testFile), 0755)
495+
if err := os.MkdirAll(filepath.Dir(testFile), 0755); err != nil {
496+
t.Fatal(err)
497+
}
496498
content := `package main
497499
func init() {}
498500
`

0 commit comments

Comments
 (0)