[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>
Mon, 26 Oct 2020 17:01:44 +0000 (17:01 +0000)
commit24cad32682d8bdbb162b0d6782a3579f814438d4
tree33282ff066a947fdb48c1f7213f5a934576b86b4
parent43eaff596fbf754228accf8a6993398e6a882f0d
[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