Skip to content

Commit b116f98

Browse files
committed
Fixed code scan issues
1 parent 934da70 commit b116f98

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

gqlgen/int.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func UnmarshalInt16(v interface{}) (int16, error) {
3030
return int16(v), nil
3131
case json.Number:
3232
u64, err := strconv.ParseUint(string(v), 10, 16)
33+
if err != nil {
34+
return 0, err
35+
}
3336
return int16(u64), err
3437
default:
3538
return 0, fmt.Errorf("%T is not an int16", v)

gqlgen/uint.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ func UnmarshalUint(v interface{}) (uint, error) {
2828
return uint(v), nil
2929
case json.Number:
3030
u64, err := strconv.ParseUint(string(v), 10, 64)
31+
if err != nil {
32+
return 0, err
33+
}
3134
return uint(u64), err
3235
default:
3336
return 0, fmt.Errorf("%T is not an uint", v)

0 commit comments

Comments
 (0)