Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckal777 committed Oct 2, 2023
1 parent 338ac7a commit 22f6454
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,14 @@ func (r *Registry) LoadInstances(config *ucfgwrap.Config, descriptor *InstancesD

func (r *Registry) loadCheckInstance(config *ucfgwrap.Config, descriptor InstanceDescriptor) error {
instanceName := descriptor.Name
subConfig := descriptor.Config
basePlugin, ok := r.CheckPlugins[descriptor.Type]
if !ok {
return fmt.Errorf("the requested check plugin type \"%v\" is not known to the registry", descriptor.Type)
}
// don't warp nil configs
var commonConf *ucfgwrap.Config
if subConfig != nil {
localConf := config.Wrap(subConfig)
if descriptor.Config != nil {
localConf := config.Wrap(descriptor.Config)
commonConf = &localConf
} else {
commonConf = nil
Expand All @@ -242,15 +241,14 @@ func (r *Registry) loadCheckInstance(config *ucfgwrap.Config, descriptor Instanc

func (r *Registry) loadNotificationInstance(config *ucfgwrap.Config, descriptor NotificationDescriptor) error {
instanceName := descriptor.Name
subConfig := descriptor.Config
basePlugin, ok := r.NotificationPlugins[descriptor.Type]
if !ok {
return fmt.Errorf("the requested notification plugin type \"%v\" is not known to the registry", descriptor.Type)
}
// don't warp nil configs
var commonConf *ucfgwrap.Config
if subConfig != nil {
localConf := config.Wrap(subConfig)
if descriptor.Config != nil {
localConf := config.Wrap(descriptor.Config)
commonConf = &localConf
} else {
commonConf = nil
Expand Down Expand Up @@ -287,15 +285,14 @@ func (r *Registry) loadNotificationInstance(config *ucfgwrap.Config, descriptor

func (r *Registry) loadTriggerInstance(config *ucfgwrap.Config, descriptor InstanceDescriptor) error {
instanceName := descriptor.Name
subConfig := descriptor.Config
basePlugin, ok := r.TriggerPlugins[descriptor.Type]
if !ok {
return fmt.Errorf("the requested trigger plugin type \"%v\" is not known to the registry", descriptor.Type)
}
// don't warp nil configs
var commonConf *ucfgwrap.Config
if subConfig != nil {
localConf := config.Wrap(subConfig)
if descriptor.Config != nil {
localConf := config.Wrap(descriptor.Config)
commonConf = &localConf
} else {
commonConf = nil
Expand Down

0 comments on commit 22f6454

Please sign in to comment.