decode.go
func (d Decoder) DecodeMap(f func(Decoder, Decoder) error) (err error) {
	var typ Type

	if d.off != 0 {
		if d.off, err = 0, d.Parser.ParseMapValue(d.off-1); err != nil {
			return
		}
	}

	if typ, err = d.Parser.ParseType(); err != nil {
		return
	}

	err = d.decodeMapImpl(typ, f)
	return
}
func (d Decoder) DecodeMap(f func(Decoder, Decoder) error) (err error) {
	var typ Type

	if d.off != 0 {
		if d.off, err = 0, d.Parser.ParseMapValue(d.off-1); err != nil {
			return
		}
	}

	if typ, err = d.Parser.ParseType(); err != nil {
		return
	}

	err = d.decodeMapImpl(typ, f)
	return
}
// DecodeMap provides the implementation of the algorithm for decoding maps,
// where f is called to decode each pair of key and value.
//
// The function f is expected to decode two values from the map, the first one
// being the key and the second the associated value. The first decoder must be
// used to decode the key, the second one for the value.