[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)
committerPeter Michael Green <plugwash@raspbian.org>
Sun, 22 Nov 2020 14:00:47 +0000 (14:00 +0000)
commitb4d6bcfb6351a883558f269b3e947d5836fea8f1
tree6cff4f85bb9a00873be5efcc3b405806548fd377
parent3e9820d42b1cbdee7eb33d9895a9a753b3617f7c
[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