summaryrefslogtreecommitdiff
path: root/plugins/checker
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-21 13:25:36 +0300
committerValery Piashchynski <[email protected]>2021-01-21 13:25:36 +0300
commit7da6c78449776e1f3c6716250bca0b712a0423a4 (patch)
treef3512de66aca2bba408485a0ea2fc936c0e4fb9b /plugins/checker
parent0ff05b2732b4fd0783f959c94c54d7e39169f979 (diff)
Uniform all configs
Add debug server Check nil's for all plugin intialization
Diffstat (limited to 'plugins/checker')
-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