feature_adapter.go 228 B

12345678910111213
  1. package jsoniter
  2. import "io"
  3. // Unmarshal adapts to json/encoding APIs
  4. func Unmarshal(data []byte, v interface{}) error {
  5. iter := ParseBytes(data)
  6. iter.Read(v)
  7. if iter.Error == io.EOF {
  8. return nil
  9. }
  10. return iter.Error
  11. }