tinylib / msgp

A Go code generator for MessagePack / msgpack.org[Go]
MIT License
1.77k stars 189 forks source link

allownil: Allocate 0 length slices #336

Closed klauspost closed 4 months ago

klauspost commented 8 months ago

When allownil is enabled, always allocate zero length slices.

This ensures roundtrips with 0-length slices are not returned as nil.

Replaces #304

Adds tests. Bonus: Don't shell out to test issue 94.

klauspost commented 4 months ago

With no objections I will humbly merge this.