mirror of
https://github.com/json-iterator/go.git
synced 2024-11-27 08:30:57 +02:00
15 lines
217 B
Go
15 lines
217 B
Go
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
|
|
}
|