fix incorrect conversion between integer types (#824)

pull/825/head
Tony Chen 4 years ago committed by GitHub
parent a6c985e9c9
commit d92c1edc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      transport/http/binding/proto.go

@ -137,7 +137,7 @@ func parseField(fd protoreflect.FieldDescriptor, value string) (protoreflect.Val
} }
v := enum.Descriptor().Values().ByName(protoreflect.Name(value)) v := enum.Descriptor().Values().ByName(protoreflect.Name(value))
if v == nil { if v == nil {
i, err := strconv.Atoi(value) i, err := strconv.ParseInt(value, 10, 32)
if err != nil { if err != nil {
return protoreflect.Value{}, fmt.Errorf("%q is not a valid value", value) return protoreflect.Value{}, fmt.Errorf("%q is not a valid value", value)
} }

Loading…
Cancel
Save