Skip to content

Commit 9378bc2

Browse files
refactor: Simplify argument appending for paths in RunTrivy function
1 parent ce9f57b commit 9378bc2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tools/trivyRunner.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ func RunTrivy(repositoryToAnalyseDirectory string, trivyBinary string, pathsToCh
2424

2525
// Add specific targets or use current directory
2626
if len(pathsToCheck) > 0 {
27-
for _, path := range pathsToCheck {
28-
cmd.Args = append(cmd.Args, path)
29-
}
27+
cmd.Args = append(cmd.Args, pathsToCheck...)
3028
} else {
3129
cmd.Args = append(cmd.Args, ".")
3230
}

0 commit comments

Comments
 (0)