You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-24 23:16:47 +02:00
#57 copy bytes
This commit is contained in:
@ -153,7 +153,7 @@ func (cfg *frozenConfig) MarshalToString(v interface{}) (string, error) {
|
|||||||
defer cfg.returnStream(stream)
|
defer cfg.returnStream(stream)
|
||||||
stream.WriteVal(v)
|
stream.WriteVal(v)
|
||||||
if stream.Error != nil {
|
if stream.Error != nil {
|
||||||
return nil, stream.Error
|
return "", stream.Error
|
||||||
}
|
}
|
||||||
return string(stream.Buffer()), nil
|
return string(stream.Buffer()), nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user