-
Notifications
You must be signed in to change notification settings - Fork 244
bugfix: int32 is converted to incorrect string #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #416 +/- ##
=======================================
Coverage 55.19% 55.19%
=======================================
Files 87 87
Lines 5479 5479
=======================================
Hits 3024 3024
Misses 2233 2233
Partials 222 222 ☔ View full report in Codecov by Sentry. |
Yang-33
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks @mekpavit !
| "github.com/line/line-bot-sdk-go/v8/linebot/messaging_api" | ||
| ) | ||
|
|
||
| func TestGetFollowers_ItShouldCorrectlyPassLimitQueryParameter(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
This bug was fixed as v8.2.1 , thank you! |
Currently,
stringifymacro inapi.pebbledoesn't handleint32Go type properly. It directly usesstring(...)to convertint32tostringwhich will generate a UTF-8 character corresponding to the value of int instead. For example,string(57)will result in"9"instead of"57". This bug makesMessagingApiAPI.GetFollowers(start string, limit int32)to be nearly impossible to use.To fix this, this PR changes add another condition to
stringifymacro forIntegertype. With this change, it will usestrconv.FormatInteger(int64(...), 10)instead ofstring(...)which yield a correct string value.Apart from the bugfix, I also refactor
api.pebblea bit to re-usestringifymacro for any place required to usestringtype. And also add another condition tostringifymacro to not doing an unnecessary string-conversion again forstringtype.