1
0
mirror of https://github.com/json-iterator/go.git synced 2024-11-24 08:22:14 +02:00
json-iterator/feature_adapter.go

14 lines
228 B
Go
Raw Normal View History

2016-12-04 16:50:53 +02:00
package jsoniter
2016-12-05 07:20:27 +02:00
import "io"
// Unmarshal adapts to json/encoding APIs
2016-12-04 16:50:53 +02:00
func Unmarshal(data []byte, v interface{}) error {
iter := ParseBytes(data)
iter.Read(v)
2016-12-05 07:20:27 +02:00
if iter.Error == io.EOF {
return nil
}
2016-12-04 16:50:53 +02:00
return iter.Error
}