Clarify error message when overriding int and uint values

This commit is contained in:
Ciprian Hacman 2023-06-30 07:32:26 +03:00
parent c90bdc791e
commit 83de21981a
1 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ func setType(v reflect.Value, newValue string) error {
v64 := int64(v) v64 := int64(v)
newV = reflect.ValueOf(v64) newV = reflect.ValueOf(v64)
default: default:
panic("missing case in switch") panic("missing case in int switch")
} }
case "uint64", "uint32", "uint16", "uint": case "uint64", "uint32", "uint16", "uint":
v, err := strconv.Atoi(newValue) v, err := strconv.Atoi(newValue)
@ -183,7 +183,7 @@ func setType(v reflect.Value, newValue string) error {
v64 := uint64(v) v64 := uint64(v)
newV = reflect.ValueOf(v64) newV = reflect.ValueOf(v64)
default: default:
panic("missing case in switch") panic("missing case in uint switch")
} }
case "intstr.IntOrString": case "intstr.IntOrString":
newV = reflect.ValueOf(intstr.Parse(newValue)) newV = reflect.ValueOf(intstr.Parse(newValue))