code: func (d *ConfigDuration) UnmarshalJSON(b []byte) error {
  	s := ""
  	err := json.Unmarshal(b, &s)
  	if err != nil {
  		if _, ok := err.(*json.UnmarshalTypeError); ok {
  			return ErrDurationMustBeString
  		}
  		return err
  	}
  	dd, err := time.ParseDuration(s)
  	d.Duration = dd
  	return err
  }
docs: // UnmarshalJSON parses a string into a ConfigDuration using
  // time.ParseDuration.  If the input does not unmarshal as a
  // string, then UnmarshalJSON returns ErrDurationMustBeString.