Validate validates the config
(cfg *config.Config)
| 37 | |
| 38 | // Validate validates the config |
| 39 | func Validate(cfg *config.Config) error { |
| 40 | if cfg.Postprocessing.Delayprocessing != 0 { |
| 41 | if !contains(cfg.Postprocessing.Steps, events.PPStepDelay) { |
| 42 | if len(cfg.Postprocessing.Steps) > 0 { |
| 43 | s := strings.Join(append(cfg.Postprocessing.Steps, string(events.PPStepDelay)), ",") |
| 44 | fmt.Printf("Added delay step to the list of postprocessing steps. NOTE: Use envvar `POSTPROCESSING_STEPS=%s` to suppress this message and choose the order of postprocessing steps.\n", s) |
| 45 | } |
| 46 | |
| 47 | cfg.Postprocessing.Steps = append(cfg.Postprocessing.Steps, string(events.PPStepDelay)) |
| 48 | } |
| 49 | } |
| 50 | return nil |
| 51 | } |
| 52 | |
| 53 | func contains(all []string, candidate events.Postprocessingstep) bool { |
| 54 | for _, s := range all { |
no test coverage detected