mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-12 15:50:15 -08:00
Add linter check support (#679)
* add linter supports * add only minor version * use latest version * Fix println with format issue * Fix test * Fix tests * For slice with unknown length, preallocating the array * fix code-coverage * Removed linter rules * Reverting linter fixes, adding TODO for later * Ignore linter error for import * Remove another err var. * Ignore shadow error * Fixes * Fix issue * Add back goimports local-prefixes * Update local prefixes * Removed extra spaces and merge the imports * more refactoring * Update photon.go Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
This commit is contained in:
@@ -32,7 +32,7 @@ func debianEOL() {
|
||||
if len(fields) < 6 && fields[0] != "" {
|
||||
fmt.Printf("\"%s\": time.Date(3000, 1, 1, 23, 59, 59, 0, time.UTC),\n", fields[0])
|
||||
} else if len(fields) == 6 {
|
||||
eol, _ := time.Parse("2006-1-2", fields[5])
|
||||
eol, _ := time.Parse("2006-1-2", fields[5]) // nolint: errcheck
|
||||
fmt.Printf("\"%s\": time.Date(%d, %d, %d, 23, 59, 59, 0, time.UTC),\n", fields[0], eol.Year(), eol.Month(), eol.Day())
|
||||
}
|
||||
}
|
||||
@@ -49,8 +49,7 @@ func ubuntuEOL() {
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
fields := strings.Split(line, ",")
|
||||
|
||||
eol, _ := time.Parse("2006-1-2", fields[len(fields)-1])
|
||||
eol, _ := time.Parse("2006-1-2", fields[len(fields)-1]) // nolint: errcheck
|
||||
fmt.Printf("\"%s\": time.Date(%d, %d, %d, 23, 59, 59, 0, time.UTC),\n", strings.Fields(fields[0])[0], eol.Year(), eol.Month(), eol.Day())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user