1
0
mirror of https://github.com/json-iterator/go.git synced 2025-06-21 23:07:33 +02:00

support customize reflection

This commit is contained in:
Tao Wen
2016-12-05 13:20:27 +08:00
parent 8ef8e04fbc
commit 9873b4d32c
3 changed files with 120 additions and 14 deletions

View File

@ -1,9 +1,14 @@
package jsoniter
import "io"
// adapt to json/encoding api
func Unmarshal(data []byte, v interface{}) error {
iter := ParseBytes(data)
iter.Read(v)
if iter.Error == io.EOF {
return nil
}
return iter.Error
}