Use defined interface for cast

This commit is contained in:
Chris Roberts 2021-07-20 15:52:31 -07:00 committed by Paul Hinze
parent a8ef49b4fe
commit 609930c8bf
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -73,9 +73,7 @@ func (cc *componentCreator) Create(
scope interface{},
pluginName string,
) (*Component, error) {
s, ok := scope.(interface {
startPlugin(context.Context, component.Type, string) (*plugin.Instance, error)
})
s, ok := scope.(pluginer)
if !ok {
panic("the scope provided is invalid")
}