code: func safeDuration(dur string, defaultDur time.Duration) time.Duration {
  	d, err := time.ParseDuration(dur)
  	if err != nil {
  		log.Printf("Invalid duration '%s', using default of %s", dur, defaultDur)
  		return defaultDur
  	}
  	return d
  }
docs: // safeDuration returns either the parsed duration or a default value