You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-27 23:18:42 +02:00
fix nil attachment on stream in custom encoder on sorted map
This commit is contained in:
@ -200,6 +200,7 @@ type stringModeStringEncoder struct {
|
||||
|
||||
func (encoder *stringModeStringEncoder) Encode(ptr unsafe.Pointer, stream *Stream) {
|
||||
tempStream := encoder.cfg.BorrowStream(nil)
|
||||
tempStream.Attachment = stream.Attachment
|
||||
defer encoder.cfg.ReturnStream(tempStream)
|
||||
encoder.elemEncoder.Encode(ptr, tempStream)
|
||||
stream.WriteString(string(tempStream.Buffer()))
|
||||
|
Reference in New Issue
Block a user