-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
jsonpb: unexpected output for small negative google.protobuf.Duration (again) #1219
Comments
It seems to be fixed by protocolbuffers/protobuf-go@e96d591. May you tag a new release please? |
Sorry about that, it probably regressed when jsonpb was rewritten in terms of protoreflect. The PR you pointed to is not the fix for it. This issue does not exist in V2, i.e. google.golang.org/protobuf. It was fixed for V1 in #885. Anyways, I'll send a PR to fix this. |
Negative nanosecond should not have negative sign after decimal point. Add check for max and min seconds. Fixes golang#1219.
This is not a regression starting in v1.4.x, but one that has been there since v1.1.0. The bug was introduced in #492 over 2.5 years ago. If anything, we probably had the bug in the new module in the first place because we copied similar logic over. |
Negative nanosecond should not have negative sign after decimal point. Add check for max and min seconds. Fixes #1219.
Thank you for resolving that issue quickly, and for the new tag! |
What version of protobuf and what language are you using?
Version: v1.4.2
What did you do?
https://github.com/AlekSi/go-bug/tree/master/jsonpb
What did you expect to see?
"-0.000000001s"
What did you see instead?
Unexpected result: "0.-00000001s"
Anything else we should know about your project / environment?
Issue #883 is back for 1.4.2.
The text was updated successfully, but these errors were encountered: