-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix null encoding for nil pointer #368
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #368 +/- ##
==========================================
+ Coverage 69.23% 69.32% +0.09%
==========================================
Files 28 28
Lines 3146 3149 +3
==========================================
+ Hits 2178 2183 +5
+ Misses 745 744 -1
+ Partials 223 222 -1 ☔ View full report in Codecov by Sentry. |
@ahaostudy the checking nil is not implemented completely, I think we can fix it, and not need to add a special config for it. I change the code as follow, and it works. You can update this PR, and then I will approve it. |
In this implementation, support for encoding |
ref #369 |
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.
LGTM
What this PR does:
In the previous implementation, dubbo-go-hessian2 would encode
nil
values of a specified type as empty bytes.For example:
However, the expected encoding for
nil
values should be[]byte("N")
, regardless of the type ofnil
value.This PR addresses the above issue. It encodes
nil
values of any type as[]byte("N")
.To avoid impacting existing code, this feature is designed as an optional option.
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: