code: func RandomDuration(max time.Duration) time.Duration {
  	randomVal, err := rand.Int(rand.Reader, big.NewInt(int64(max)))
  	if err != nil {
  		return max / 2
  	}
  	return time.Duration(randomVal.Int64())
  }
docs: // RandomDuration returns a duration in a range [0, max)