package handler_utils import ( "gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/errors" ) // ValidateCronHandlers checks that all handlers are correctly defined using one of the supported handler types // return updated handlers (with additional information -> N/A for cron) func ValidateCronHandlers(handlers map[string]func() error) (map[string]func() error, error) { countHandler := 0 for cronName, cronFunc := range handlers { if cronName == "" { return nil, errors.Errorf("blank handlerName") } if cronFunc == nil { return nil, errors.Errorf("nil handler on %s", cronName) } countHandler++ } return handlers, nil }