code: func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error) {
  	surge, err := intstrutil.GetValueFromIntOrPercent(intstrutil.ValueOrDefault(maxSurge, intstrutil.FromInt(0)), int(desired), true)
  	if err != nil {
  		return 0, 0, err
  	}
  	unavailable, err := intstrutil.GetValueFromIntOrPercent(intstrutil.ValueOrDefault(maxUnavailable, intstrutil.FromInt(0)), int(desired), false)
  	if err != nil {
  		return 0, 0, err
  	}
  
  	if surge == 0 && unavailable == 0 {
  		// Validation should never allow the user to explicitly use zero values for both maxSurge
  		// maxUnavailable. Due to rounding down maxUnavailable though, it may resolve to zero.
  		// If both fenceposts resolve to zero, then we should set maxUnavailable to 1 on the
  		// theory that surge might not work due to quota.
  		unavailable = 1
  	}
  
  	return int32(surge), int32(unavailable), nil
  }
docs: // ResolveFenceposts resolves both maxSurge and maxUnavailable. This needs to happen in one
  // step. For example:
  //
  // 2 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1), then old(-1), then new(+1)
  // 1 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1)
  // 2 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1)
  // 1 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1)
  // 2 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1)
  // 1 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1)