package producer import "fmt" type Config struct { Hosts []string `yaml:"hosts"` } func (c Config) Invalidate() error { if len(c.Hosts) < 1 { return fmt.Errorf("at least one bootstrap server / host must be provided") } return nil }