Skip to content

Commit 8bbb655

Browse files
build(deps): bump github.com/securego/gosec/v2 from 2.15.0 to 2.16.0 (#3843)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 6fffff0 commit 8bbb655

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ require (
8383
github.com/sanposhiho/wastedassign/v2 v2.0.7
8484
github.com/sashamelentyev/interfacebloat v1.1.0
8585
github.com/sashamelentyev/usestdlibvars v1.23.0
86-
github.com/securego/gosec/v2 v2.15.0
86+
github.com/securego/gosec/v2 v2.16.0
8787
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c
8888
github.com/shirou/gopsutil/v3 v3.23.4
8989
github.com/sirupsen/logrus v1.9.2
@@ -187,7 +187,7 @@ require (
187187
golang.org/x/mod v0.10.0 // indirect
188188
golang.org/x/sync v0.2.0 // indirect
189189
golang.org/x/sys v0.8.0 // indirect
190-
golang.org/x/text v0.7.0 // indirect
190+
golang.org/x/text v0.9.0 // indirect
191191
google.golang.org/protobuf v1.28.0 // indirect
192192
gopkg.in/ini.v1 v1.67.0 // indirect
193193
gopkg.in/yaml.v2 v2.4.0 // indirect

go.sum

+9-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/golinters/gosec.go

+12-11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"sync"
1111

1212
"github.com/securego/gosec/v2"
13+
"github.com/securego/gosec/v2/issue"
1314
"github.com/securego/gosec/v2/rules"
1415
"golang.org/x/tools/go/analysis"
1516
"golang.org/x/tools/go/packages"
@@ -75,7 +76,7 @@ func runGoSec(lintCtx *linter.Context, pass *analysis.Pass, settings *config.GoS
7576
TypesInfo: pass.TypesInfo,
7677
}
7778

78-
analyzer.Check(pkg)
79+
analyzer.CheckRules(pkg)
7980

8081
secIssues, _, _ := analyzer.Report()
8182
if len(secIssues) == 0 {
@@ -176,27 +177,27 @@ func gosecRuleFilters(includes, excludes []string) []rules.RuleFilter {
176177
}
177178

178179
// code borrowed from https://github.com/securego/gosec/blob/69213955dacfd560562e780f723486ef1ca6d486/cmd/gosec/main.go#L250-L262
179-
func convertToScore(str string) (gosec.Score, error) {
180+
func convertToScore(str string) (issue.Score, error) {
180181
str = strings.ToLower(str)
181182
switch str {
182183
case "", "low":
183-
return gosec.Low, nil
184+
return issue.Low, nil
184185
case "medium":
185-
return gosec.Medium, nil
186+
return issue.Medium, nil
186187
case "high":
187-
return gosec.High, nil
188+
return issue.High, nil
188189
default:
189-
return gosec.Low, fmt.Errorf("'%s' is invalid, use low instead. Valid options: low, medium, high", str)
190+
return issue.Low, fmt.Errorf("'%s' is invalid, use low instead. Valid options: low, medium, high", str)
190191
}
191192
}
192193

193194
// code borrowed from https://github.com/securego/gosec/blob/69213955dacfd560562e780f723486ef1ca6d486/cmd/gosec/main.go#L264-L276
194-
func filterIssues(issues []*gosec.Issue, severity, confidence gosec.Score) []*gosec.Issue {
195-
res := make([]*gosec.Issue, 0)
195+
func filterIssues(issues []*issue.Issue, severity, confidence issue.Score) []*issue.Issue {
196+
res := make([]*issue.Issue, 0)
196197

197-
for _, issue := range issues {
198-
if issue.Severity >= severity && issue.Confidence >= confidence {
199-
res = append(res, issue)
198+
for _, i := range issues {
199+
if i.Severity >= severity && i.Confidence >= confidence {
200+
res = append(res, i)
200201
}
201202
}
202203

0 commit comments

Comments
 (0)