summaryrefslogtreecommitdiff
path: root/plugins/checker/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/checker/plugin.go')
-rw-r--r--plugins/checker/plugin.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/checker/plugin.go b/plugins/checker/plugin.go
index ef184b02..407cb2fa 100644
--- a/plugins/checker/plugin.go
+++ b/plugins/checker/plugin.go
@@ -27,15 +27,14 @@ type Plugin struct {
func (c *Plugin) Init(log logger.Logger, cfg config.Configurer) error {
const op = errors.Op("checker_plugin_init")
+ if !cfg.Has(PluginName) {
+ return errors.E(op, errors.Disabled)
+ }
err := cfg.UnmarshalKey(PluginName, &c.cfg)
if err != nil {
return errors.E(op, errors.Disabled, err)
}
- if c.cfg == nil {
- return errors.E(errors.Disabled)
- }
-
c.registry = make(map[string]Checker)
c.log = log
return nil