1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-19 21:18:07 +02:00

fix incorrect conversion between integer types ()

This commit is contained in:
Tony Chen 2021-04-12 23:43:10 +08:00 committed by GitHub
parent a6c985e9c9
commit d92c1edc26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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