You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I pass an isEmptyFunc function to RegisterTypeEncoderFunc, my isEmptyFunc is never called. My EncoderFunc for the type does get called. Request is for the isEmptyFunc to be called.
My data looks like this, where TypeC is an array that can have empty bytes saved. When I use jsoniter.RegisterFieldEncoderFunc(reflect2.TypeOf(TypeB{}).String(), "TypeC", encodeB, isBEmpty), both encodeB and isBEmpty functions get called, but I lose the support for array type and can't parse out the empty []byte
type TypeA struct {
TypeB TypeB
}
type TypeB struct {
TypeC []TypeC `msgpack:"as_array" json:"omitempty"`
}
type TypeC []byte
func fun() {
jsoniter.RegisterTypeEncoderFunc(reflect2.TypeOf(TypeC{}).String(), encodeFunc, isEmptyFunc)
}
The text was updated successfully, but these errors were encountered:
When I pass an
isEmptyFunc
function toRegisterTypeEncoderFunc
, myisEmptyFunc
is never called. MyEncoderFunc
for the type does get called. Request is for theisEmptyFunc
to be called.My data looks like this, where
TypeC
is an array that can have empty bytes saved. When I usejsoniter.RegisterFieldEncoderFunc(reflect2.TypeOf(TypeB{}).String(), "TypeC", encodeB, isBEmpty)
, bothencodeB
andisBEmpty
functions get called, but I lose the support for array type and can't parse out the empty []byteThe text was updated successfully, but these errors were encountered: