mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-19 21:18:07 +02:00
fix incorrect conversion between integer types (#824)
This commit is contained in:
parent
a6c985e9c9
commit
d92c1edc26
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user