You've already forked json-iterator
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user