Skip to content

Commit

Permalink
fix(codecs/form): linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jochumdev committed Sep 17, 2024
1 parent 0cb00bb commit 07a72b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions codecs/form/proto_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func parseField(fieldDesc protoreflect.FieldDescriptor, value string) (protorefl
return protoreflect.Value{}, fmt.Errorf("%q is not a valid value", value)
}

if v = enum.Descriptor().Values().ByNumber(protoreflect.EnumNumber(i)); v == nil { //nolint:gosec
if v = enum.Descriptor().Values().ByNumber(protoreflect.EnumNumber(i)); v == nil {
return protoreflect.Value{}, fmt.Errorf("%q is not a valid value", value)
}
}
Expand All @@ -199,7 +199,7 @@ func parseField(fieldDesc protoreflect.FieldDescriptor, value string) (protorefl
return protoreflect.Value{}, err
}

return protoreflect.ValueOfInt32(int32(v)), nil //nolint:gosec
return protoreflect.ValueOfInt32(int32(v)), nil
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
v, err := strconv.ParseInt(value, 10, 64) //nolint:gomnd
if err != nil {
Expand All @@ -213,7 +213,7 @@ func parseField(fieldDesc protoreflect.FieldDescriptor, value string) (protorefl
return protoreflect.Value{}, err
}

return protoreflect.ValueOfUint32(uint32(v)), nil //nolint:gosec
return protoreflect.ValueOfUint32(uint32(v)), nil
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
v, err := strconv.ParseUint(value, 10, 64) //nolint:gomnd
if err != nil {
Expand Down Expand Up @@ -305,7 +305,7 @@ func parseMessage(messageDesc protoreflect.MessageDescriptor, value string) (pro
return protoreflect.Value{}, err
}

msg = wrapperspb.Int32(int32(v)) //nolint:gosec
msg = wrapperspb.Int32(int32(v))
case "google.protobuf.UInt64Value":
v, err := strconv.ParseUint(value, 10, 64) //nolint:gomnd
if err != nil {
Expand All @@ -319,7 +319,7 @@ func parseMessage(messageDesc protoreflect.MessageDescriptor, value string) (pro
return protoreflect.Value{}, err
}

msg = wrapperspb.UInt32(uint32(v)) //nolint:gosec
msg = wrapperspb.UInt32(uint32(v))
case "google.protobuf.BoolValue":
v, err := strconv.ParseBool(value)
if err != nil {
Expand Down

0 comments on commit 07a72b3

Please sign in to comment.