Skip to content

Commit

Permalink
fix(plugin): resolve a closure (#1207)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
afdesk authored Sep 2, 2021
1 parent b6d9c30 commit 0e777d3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/commands/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0e777d3

Please sign in to comment.