Pass plugin loader by interface

This commit is contained in:
Austin Roberts 2021-08-31 15:41:27 -05:00
parent d9d51dd345
commit 820a0af71c
2 changed files with 3 additions and 3 deletions

2
go.mod
View File

@ -49,7 +49,7 @@ require (
github.com/naoina/go-stringutil v0.1.0 // indirect
github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416
github.com/olekukonko/tablewriter v0.0.5
github.com/openrelayxyz/plugeth-utils v0.0.0
github.com/openrelayxyz/plugeth-utils v0.0.1
github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7
github.com/prometheus/tsdb v0.7.1
github.com/rjeczalik/notify v0.9.1

View File

@ -113,11 +113,11 @@ 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, *PluginLoader))
_, ok := i.(func(*cli.Context, core.PluginLoader))
return ok
})
for _, fni := range fns {
if fn, ok := fni.(func(*cli.Context, *PluginLoader)); ok {
if fn, ok := fni.(func(*cli.Context, core.PluginLoader)); ok {
fn(ctx, pl)
}
}