1
0
mirror of https://github.com/json-iterator/go.git synced 2025-07-03 23:30:41 +02:00

expose OptionalEncoder&OptionalDecoder; add attachment to Stream&Iterator for customized decoder/encoder

This commit is contained in:
Tao Wen
2017-11-08 11:41:45 +08:00
parent aed5a81f09
commit b1b003864e
8 changed files with 38 additions and 34 deletions

View File

@ -21,7 +21,7 @@ func encoderOfArray(cfg *frozenConfig, typ reflect.Type) (ValEncoder, error) {
return nil, err
}
if typ.Elem().Kind() == reflect.Map {
encoder = &optionalEncoder{encoder}
encoder = &OptionalEncoder{encoder}
}
return &arrayEncoder{typ, typ.Elem(), encoder}, nil
}