Merge pull request #86172 from liggitt/intstr

Clarify intstr.IntValue() behavior
This commit is contained in:
Kubernetes Prow Robot
2020-01-15 08:25:35 -08:00
committed by GitHub
3 changed files with 15 additions and 8 deletions

View File

@@ -97,7 +97,8 @@ func (intstr *IntOrString) String() string {
}
// IntValue returns the IntVal if type Int, or if
// it is a String, will attempt a conversion to int.
// it is a String, will attempt a conversion to int,
// returning 0 if a parsing error occurs.
func (intstr *IntOrString) IntValue() int {
if intstr.Type == String {
i, _ := strconv.Atoi(intstr.StrVal)