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:
afdesk
2021-09-02 17:29:54 +06:00
committed by GitHub
parent b6d9c30eea
commit 0e777d386e

View File

@@ -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,