func (cfg Config) validate(p Parameters) error {
	if err := p.validate(); err != nil {
		return err
	}
	switch {
	case cfg.StopDur <= 0:
		return fmt.Errorf("stop timeout duration required")
	case cfg.CacheSec < 0:
		return fmt.Errorf("nonnegative cache seconds required")
	case cfg.HTTPSPort <= 0:
		return fmt.Errorf("positive https port required")
	case len(cfg.Version) == 0:
		return fmt.Errorf("version required")
	}
	for i, r := range cfg.Version {
		if !unicode.In(r, unicode.Letter, unicode.Digit) {
			return fmt.Errorf("only letters and digits are allowed in version: invalid rune at index %v of '%v': '%v'", i, cfg.Version, string(r))
		}
	}
	return nil
}
// validate ensures the configuration and parameters have no errors.
validate ensures the configuration and parameters have no errors.
// validate ensures the configuration and parameters have no errors .
func (cfg Config) validate(p Parameters) error {
	if err := p.validate(); err != nil {
		return err
	}
	switch {
	case cfg.StopDur <= 0:
		return fmt.Errorf("stop timeout duration required")
	case cfg.CacheSec < 0:
		return fmt.Errorf("nonnegative cache seconds required")
	case cfg.HTTPSPort <= 0:
		return fmt.Errorf("positive https port required")
	case len(cfg.Version) == 0:
		return fmt.Errorf("version required")
	}
	for i, r := range cfg.Version {
		if !unicode.In(r, unicode.Letter, unicode.Digit) {
			return fmt.Errorf("only letters and digits are allowed in version: invalid rune at index %v of '%v': '%v'", i, cfg.Version, string(r))
		}
	}
	return nil
}
func ( cfg Config ) validate ( p Parameters ) error { if err := p . validate ( ) ; err != nil { return err } switch { case cfg . StopDur <= 0 : return fmt . Errorf ( " " ) case cfg . CacheSec < 0 : return fmt . Errorf ( " " ) case cfg . HTTPSPort <= 0 : return fmt . Errorf ( " " ) case len ( cfg . Version ) == 0 : return fmt . Errorf ( " " ) } for i , r := range cfg . Version { if ! unicode . In ( r , unicode . Letter , unicode . Digit ) { return fmt . Errorf ( " " , i , cfg . Version , string ( r ) ) } } return nil }
validate ensures the configuration and parameters have no errors.
validate ensures the configuration and parameters have no errors .