[PATCH] THRIFT-5270: Fix wrong int to string conversions
authorYuxuan 'fishy' Wang <yuxuan.wang@reddit.com>
Sat, 29 Aug 2020 00:20:31 +0000 (17:20 -0700)
committerLaszlo Boszormenyi (GCS) <gcs@debian.org>
Fri, 24 Sep 2021 15:18:04 +0000 (16:18 +0100)
commit885c72eda79adb40cfa3231a3104c6f460e56b8e
tree0a397ed2caa2a6343c96e46e75f00662c7e6a4fb
parent92ccc9531d40d4117165b64cc057016648c4f58b
[PATCH] THRIFT-5270: Fix wrong int to string conversions

Client: go

Starting from go 1.15, go test starts to complain about wrongly used int
to string conversions:

    ./field.go:58:83: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./numeric.go:72:12: conversion from int64 to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./json_protocol_test.go:612:92: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
    ./simple_json_protocol_test.go:685:96: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)

json_protocol_test and simple_json_protocol_test usages are actually
already in format arg so just remove the conversion is good enough.
field is no longer used anywhere so just removed it (there's one line of
commented out code in compact_protocol so remove that line as well). The
one in numeric.go is actually a bug. We didn't set sValue correctly in
NewNumericFromI64 and NewNumericFromI32 functions.

Gbp-Pq: Name Fix_wrong_int_to_string_conversions.patch
lib/go/thrift/compact_protocol.go
lib/go/thrift/field.go [deleted file]
lib/go/thrift/json_protocol_test.go
lib/go/thrift/numeric.go
lib/go/thrift/simple_json_protocol_test.go