Skip to content

Commit

Permalink
Fixed code scan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mrz1836 committed Mar 28, 2022
1 parent 934da70 commit b116f98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gqlgen/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func UnmarshalInt16(v interface{}) (int16, error) {
return int16(v), nil
case json.Number:
u64, err := strconv.ParseUint(string(v), 10, 16)
if err != nil {
return 0, err
}
return int16(u64), err
default:
return 0, fmt.Errorf("%T is not an int16", v)
Expand Down
3 changes: 3 additions & 0 deletions gqlgen/uint.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func UnmarshalUint(v interface{}) (uint, error) {
return uint(v), nil
case json.Number:
u64, err := strconv.ParseUint(string(v), 10, 64)
if err != nil {
return 0, err
}
return uint(u64), err
default:
return 0, fmt.Errorf("%T is not an uint", v)
Expand Down

0 comments on commit b116f98

Please sign in to comment.