Skip to content

nil encoding not correct #369

Open
Open
@tiltwind

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions