mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 07:10:41 -08:00
fix(plugin): resolve a closure (#1207)
There is a closure inside a function for Action field: variable p always refers on the last plugin. solution: redefine variable inside the for loop. Fixes #1086
This commit is contained in:
@@ -84,6 +84,7 @@ func LoadCommands() cli.Commands {
|
||||
return nil
|
||||
}
|
||||
for _, p := range plugins {
|
||||
p := p
|
||||
cmd := &cli.Command{
|
||||
Name: p.Name,
|
||||
Usage: p.Usage,
|
||||
|
||||
Reference in New Issue
Block a user