Skip to content
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

nil encoding not correct #369

Open
tiltwind opened this issue Nov 26, 2023 · 0 comments
Open

nil encoding not correct #369

tiltwind opened this issue Nov 26, 2023 · 0 comments

Comments

@tiltwind
Copy link
Contributor

What happened:
In the previous implementation, dubbo-go-hessian2 would encode nil values of a specified type as empty bytes.

For example:

var null *int = nil

e := NewEncoder()
e.Encode(null)

len(e.buffer) == 0  // true

However, the expected encoding for nil values should be []byte("N"), regardless of the type of nil value.

What you expected to happen:
It encodes nil values of any type as []byte("N").

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant