From c45774b74b70ff57287f5a863d7cd0ea12740671 Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Mon, 12 Jul 2021 14:55:45 -0500 Subject: [PATCH] Give plugins a handle to their plugin loader This potentially allows plugins to invoke other plugins. --- plugins/plugin_loader.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/plugin_loader.go b/plugins/plugin_loader.go index dae58955e..55382dcab 100644 --- a/plugins/plugin_loader.go +++ b/plugins/plugin_loader.go @@ -113,12 +113,12 @@ func Initialize(target string, ctx *cli.Context) (err error) { func (pl *PluginLoader) Initialize(ctx *cli.Context) { fns := pl.Lookup("Initialize", func(i interface{}) bool { - _, ok := i.(func(*cli.Context) error) + _, ok := i.(func(*cli.Context, *PluginLoader) error) return ok }) for _, fni := range fns { - if fn, ok := fni.(func(*cli.Context)); ok { - fn(ctx) + if fn, ok := fni.(func(*cli.Context, *PluginLoader)); ok { + fn(ctx, pl) } } }