1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-27 08:30:57 +02:00

eof is not error

This commit is contained in:
Tao Wen 2017-06-02 16:06:33 +08:00
parent 69b742e73a
commit 5cb0d35610

View File

@ -111,6 +111,10 @@ type AdaptedDecoder struct {
func (adapter *AdaptedDecoder) Decode(obj interface{}) error {
adapter.iter.ReadVal(obj)
err := adapter.iter.Error
if err == io.EOF {
return nil
}
return adapter.iter.Error
}