[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>
Sun, 14 Feb 2021 18:50:04 +0000 (18:50 +0000)
commitd349ce1c7e53ad9603589c51da85451d016b2a59
tree8d4868dee44ee9ab11adddfc7a8f6788586f0af6
parent6557a5631438d17461e6e76751caec49aeac23a7
[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