dubbo-go-hessian2 icon indicating copy to clipboard operation
dubbo-go-hessian2 copied to clipboard

nil encoding not correct

Open tiltwind opened this issue 1 year ago • 0 comments

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?:

tiltwind avatar Nov 26 '23 08:11 tiltwind