1
0
mirror of https://github.com/json-iterator/go.git synced 2025-01-29 19:14:05 +02:00

#57 copy bytes

This commit is contained in:
Tao Wen 2017-06-17 14:36:38 +08:00
parent 952a42af6c
commit 3c8bd9ef54

View File

@ -153,7 +153,7 @@ func (cfg *frozenConfig) MarshalToString(v interface{}) (string, error) {
defer cfg.returnStream(stream)
stream.WriteVal(v)
if stream.Error != nil {
return nil, stream.Error
return "", stream.Error
}
return string(stream.Buffer()), nil
}