1
0
mirror of https://github.com/json-iterator/go.git synced 2025-07-12 23:50:19 +02:00

#197 fix place holder encoder to use EncodeInterface, WriteToStream is unsafe when the real encoder is unknown

This commit is contained in:
Tao Wen
2017-11-15 22:56:23 +08:00
parent 9fddff05f0
commit d394a135a1
2 changed files with 16 additions and 1 deletions

View File

@ -164,7 +164,7 @@ func (encoder *placeholderEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
}
func (encoder *placeholderEncoder) EncodeInterface(val interface{}, stream *Stream) {
WriteToStream(val, stream, encoder)
encoder.getRealEncoder().EncodeInterface(val, stream)
}
func (encoder *placeholderEncoder) IsEmpty(ptr unsafe.Pointer) bool {