Skip to content

Commit dc80ef0

Browse files
committed
set slice capacity instead of length
1 parent db8be72 commit dc80ef0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/golinters/vulncheck.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func NewVulncheck(settings *config.VulncheckSettings) *goanalysis.Linter {
2323
var mu sync.Mutex
2424
var resIssues []goanalysis.Issue
2525

26-
var analyzer = &analysis.Analyzer{
26+
analyzer := &analysis.Analyzer{
2727
Name: vulncheckName,
2828
Doc: vulncheckDoc,
2929
Run: goanalysis.DummyRun,
@@ -37,7 +37,6 @@ func NewVulncheck(settings *config.VulncheckSettings) *goanalysis.Linter {
3737
).WithContextSetter(func(lintCtx *linter.Context) {
3838
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
3939
issues, err := vulncheckRun(lintCtx, pass, settings)
40-
4140
if err != nil {
4241
return nil, err
4342
}
@@ -72,7 +71,7 @@ func vulncheckRun(lintCtx *linter.Context, pass *analysis.Pass, settings *config
7271
return nil, err
7372
}
7473

75-
issues := make([]goanalysis.Issue, len(r.Vulns))
74+
issues := make([]goanalysis.Issue, 0, len(r.Vulns))
7675

7776
for _, vuln := range r.Vulns {
7877
issues = append(issues, goanalysis.NewIssue(&result.Issue{

0 commit comments

Comments
 (0)