Skip to content

Commit 18d1fb6

Browse files
thatnealpatelgopherbot
authored andcommitted
internal/scan: ensure int32 is returned for Int32 field types
Change-Id: I3a2dcd6e43b2fe5a041370a10ceb2d8c440b1739 Reviewed-on: https://go-review.googlesource.com/c/pkgsite-metrics/+/682635 LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Neal Patel <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent 7740f4b commit 18d1fb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/scan/parse.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ func parseParam(param string, kind reflect.Kind) (any, error) {
204204
case reflect.String:
205205
return param, nil
206206
case reflect.Int32:
207-
return strconv.ParseInt(param, 10, 32)
207+
n, err := strconv.ParseInt(param, 10, 32)
208+
return int32(n), err
208209
case reflect.Int:
209210
return strconv.Atoi(param)
210211
case reflect.Bool:

0 commit comments

Comments
 (0)