func (d Decoder) Decode(v interface{}) error {
	to := reflect.ValueOf(v)
	if d.off != 0 {
		var err error
		if d.off, err = 0, d.Parser.ParseMapValue(d.off-1); err != nil {
			return err
		}
	}
	if !to.IsValid() {
		_, err := d.decodeInterface(to)
		return err
	}
	switch x := v.(type) {
	case ValueDecoder:
		return x.DecodeValue(d)
	}
	if to.Kind() == reflect.Ptr {
		to = to.Elem()
	}
	_, err := d.decode(to)
	return err
}
Decode expects v to be a pointer to a value in which the decoder will load
the next parsed data.

The method panics if v is neither a pointer type nor implements the
ValueDecoder interface, or if v is a nil pointer.
package objconv
import (
	"encoding"
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"time"
	"unsafe"
	"github.com/segmentio/objconv/objutil"
)
type Decoder struct {
	Parser Parser
	MapType reflect.Type
	off int  
}
func NewDecoder(p Parser) *Decoder {
	if p == nil {
		panic("objconv: the parser is nil")
	}
	return &Decoder{Parser: p}
}