kbin: arrays must be able to be encoded as null
@@ -98,7 +98,10 @@ func AppendVarintBytes(dst []byte, b []byte) []byte {
return append(dst, b...)
}
-func AppendArrayLen(dst []byte, l int) []byte {
+func AppendArrayLen(dst []byte, l int, isNil bool) []byte {
+ if isNil {
+ return AppendInt32(dst, -1)
+ }
return AppendInt32(dst, int32(l))
}
