gosec: add G602 analyzer (#4906)

This commit is contained in:
Ludovic Fernandez 2024-08-14 23:54:30 +02:00 committed by GitHub
parent 15529a9d74
commit ca0b09e5e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 3 additions and 8 deletions

View File

@ -874,7 +874,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi - G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1 - G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement - G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds
# To specify a set of rules to explicitly exclude. # To specify a set of rules to explicitly exclude.
# Available rules: https://github.com/securego/gosec#available-rules # Available rules: https://github.com/securego/gosec#available-rules
@ -914,7 +913,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi - G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1 - G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement - G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds
# Exclude generated files # Exclude generated files
# Default: false # Default: false

View File

@ -874,7 +874,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi - G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1 - G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement - G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds
# To specify a set of rules to explicitly exclude. # To specify a set of rules to explicitly exclude.
# Available rules: https://github.com/securego/gosec#available-rules # Available rules: https://github.com/securego/gosec#available-rules
@ -914,7 +913,6 @@ linters-settings:
- G504 # Import blocklist: net/http/cgi - G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1 - G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement - G601 # Implicit memory aliasing of items from a range statement
- G602 # Slice access out of bounds
# Exclude generated files # Exclude generated files
# Default: false # Default: false

View File

@ -157,8 +157,7 @@
"G503", "G503",
"G504", "G504",
"G505", "G505",
"G601", "G601"
"G602"
] ]
}, },
"govet-analyzers": { "govet-analyzers": {

View File

@ -157,8 +157,7 @@
"G503", "G503",
"G504", "G504",
"G505", "G505",
"G601", "G601"
"G602"
] ]
}, },
"govet-analyzers": { "govet-analyzers": {

View File

@ -77,6 +77,7 @@ func runGoSec(lintCtx *linter.Context, pass *analysis.Pass, settings *config.GoS
} }
analyzer.CheckRules(pkg) analyzer.CheckRules(pkg)
analyzer.CheckAnalyzers(pkg)
secIssues, _, _ := analyzer.Report() secIssues, _, _ := analyzer.Report()
if len(secIssues) == 0 { if len(secIssues) == 0 {