func (d *Decoder) swallowViaHammer() {
	var blank interface{}
	d.decodeValue(reflect.ValueOf(&blank).Elem(), decFn{})
}
this is not a smart swallow, as it allocates objects and does unnecessary work.
package codec
import (
	"encoding"
	"errors"
	"fmt"
	"io"
	"reflect"
)
const (
	msgBadDesc            = "Unrecognized descriptor byte"
	msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v"
)
var (
	onlyMapOrArrayCanDecodeIntoStructErr = errors.New("only encoded map or array can be decoded into a struct")
	cannotDecodeIntoNilErr               = errors.New("cannot decode into nil")
)
type decReader interface {
	unreadn1()
	readx(n int) []byte
	readb([]byte)
	readn1() uint8
	readn1eof() (v uint8, eof bool)
}
type decReaderByteScanner interface {
	io.Reader
	io.ByteScanner
}
type decDriver interface {
	CheckBreak() bool
	TryDecodeAsNil() bool
	IsContainerType(vt valueType) bool
	IsBuiltinType(rt uintptr) bool
	DecodeBuiltin(rt uintptr, v interface{})
	DecodeNaked() (v interface{}, vt valueType, decodeFurther bool)
	DecodeInt(bitsize uint8) (i int64)
	DecodeUint(bitsize uint8) (ui uint64)
	DecodeFloat(chkOverflow32 bool) (f float64)
	DecodeBool() (b bool)
	DecodeString() (s string)
	DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte)
	DecodeExt(v interface{}, xtag uint64, ext Ext) (realxtag uint64)
	ReadMapStart() int
	ReadArrayStart() int
	ReadMapEnd()
	ReadArrayEnd()
	ReadArrayEntrySeparator()
	ReadMapEntrySeparator()
	ReadMapKVSeparator()
}
type decNoSeparator struct{}
func (_ decNoSeparator) ReadMapEnd()              {}
func (_ decNoSeparator) ReadArrayEnd()            {}
func (_ decNoSeparator) ReadArrayEntrySeparator() {}
func (_ decNoSeparator) ReadMapEntrySeparator()   {}
func (_ decNoSeparator) ReadMapKVSeparator()      {}
type DecodeOptions struct {
	MapType reflect.Type
	SliceType reflect.Type
	ErrorIfNoField bool
	ErrorIfNoArrayExpand bool
	SignedInteger bool
}
type ioDecByteScanner struct {
	r  io.Reader
	l  byte     
	ls byte     
	b  [1]byte  
}
func (z *ioDecByteScanner) Read(p []byte) (n int, err error) {
	var firstByte bool
	if z.ls == 1 {
		z.ls = 2
		p[0] = z.l
		if len(p) == 1 {
			n = 1
			return
		}
		firstByte = true
		p = p[1:]
	}
	n, err = z.r.Read(p)
	if n > 0 {
		if err == io.EOF && n == len(p) {
			err = nil  
		}
		z.l = p[n-1]
		z.ls = 2
	}
	if firstByte {
		n++
	}
	return
}
func (z *ioDecByteScanner) ReadByte() (c byte, err error) {
	n, err := z.Read(z.b[:])
	if n == 1 {
		c = z.b[0]
		if err == io.EOF {
			err = nil  
		}
	}
	return
}
func (z *ioDecByteScanner) UnreadByte() (err error) {
	x := z.ls
	if x == 0 {
		err = errors.New("cannot unread - nothing has been read")
	} else if x == 1 {
		err = errors.New("cannot unread - last byte has not been read")
	} else if x == 2 {
		z.ls = 1
	}
	return
}
type ioDecReader struct {
	br decReaderByteScanner
	x  *[scratchByteArrayLen]byte
	bs ioDecByteScanner
}
func (z *ioDecReader) readx(n int) (bs []byte) {
	if n <= 0 {
		return
	}
	if n < len(z.x) {
		bs = z.x[:n]
	} else {
		bs = make([]byte, n)
	}
	if _, err := io.ReadAtLeast(z.br, bs, n); err != nil {
		panic(err)
	}
	return
}
func (z *ioDecReader) readb(bs []byte) {
	if len(bs) == 0 {
		return
	}
	if _, err := io.ReadAtLeast(z.br, bs, len(bs)); err != nil {
		panic(err)
	}
}
func (z *ioDecReader) readn1() (b uint8) {
	b, err := z.br.ReadByte()
	if err != nil {
		panic(err)
	}
	return b
}
func (z *ioDecReader) readn1eof() (b uint8, eof bool) {
	b, err := z.br.ReadByte()
	if err == nil {
	} else if err == io.EOF {
		eof = true
	} else {
		panic(err)
	}
	return
}
func (z *ioDecReader) unreadn1() {
	if err := z.br.UnreadByte(); err != nil {
		panic(err)
	}
}
var bytesDecReaderCannotUnreadErr = errors.New("cannot unread last byte read")
type bytesDecReader struct {
	b []byte  
	c int     
	a int     
}
func (z *bytesDecReader) unreadn1() {
	if z.c == 0 || len(z.b) == 0 {
		panic(bytesDecReaderCannotUnreadErr)
	}
	z.c--
	z.a++
	return
}
func (z *bytesDecReader) readx(n int) (bs []byte) {
	if n <= 0 {
	} else if z.a == 0 {
		panic(io.EOF)
	} else if n > z.a {
		panic(io.ErrUnexpectedEOF)
	} else {
		c0 := z.c
		z.c = c0 + n
		z.a = z.a - n
		bs = z.b[c0:z.c]
	}
	return
}
func (z *bytesDecReader) readn1() (v uint8) {
	if z.a == 0 {
		panic(io.EOF)
	}
	v = z.b[z.c]
	z.c++
	z.a--
	return
}
func (z *bytesDecReader) readn1eof() (v uint8, eof bool) {
	if z.a == 0 {
		eof = true
		return
	}
	v = z.b[z.c]
	z.c++
	z.a--
	return
}
func (z *bytesDecReader) readb(bs []byte) {
	copy(bs, z.readx(len(bs)))
}
type decFnInfoX struct {
	d     *Decoder
	ti    *typeInfo
	xfFn  Ext
	xfTag uint64
	seq   seqType
}
type decFnInfo struct {
	dd decDriver
	*decFnInfoX
}
type decFn struct {
	i decFnInfo
	f func(decFnInfo, reflect.Value)
}
func (f decFnInfo) builtin(rv reflect.Value) {
	f.dd.DecodeBuiltin(f.ti.rtid, rv.Addr().Interface())
}
func (f decFnInfo) rawExt(rv reflect.Value) {
	f.dd.DecodeExt(rv.Addr().Interface(), 0, nil)
}
func (f decFnInfo) ext(rv reflect.Value) {
	f.dd.DecodeExt(rv.Addr().Interface(), f.xfTag, f.xfFn)
}
func (f decFnInfo) getValueForUnmarshalInterface(rv reflect.Value, indir int8) (v interface{}) {
	if indir == -1 {
		v = rv.Addr().Interface()
	} else if indir == 0 {
		v = rv.Interface()
	} else {
		for j := int8(0); j < indir; j++ {
			if rv.IsNil() {
				rv.Set(reflect.New(rv.Type().Elem()))
			}
			rv = rv.Elem()
		}
		v = rv.Interface()
	}
	return
}
func (f decFnInfo) selferUnmarshal(rv reflect.Value) {
	f.getValueForUnmarshalInterface(rv, f.ti.csIndir).(Selfer).CodecDecodeSelf(f.d)
}
func (f decFnInfo) binaryUnmarshal(rv reflect.Value) {
	bm := f.getValueForUnmarshalInterface(rv, f.ti.bunmIndir).(encoding.BinaryUnmarshaler)
	xbs := f.dd.DecodeBytes(nil, false, true)
	if fnerr := bm.UnmarshalBinary(xbs); fnerr != nil {
		panic(fnerr)
	}
}
func (f decFnInfo) textUnmarshal(rv reflect.Value) {
	tm := f.getValueForUnmarshalInterface(rv, f.ti.tunmIndir).(encoding.TextUnmarshaler)
	fnerr := tm.UnmarshalText(f.dd.DecodeBytes(f.d.b[:], true, true))
	if fnerr != nil {
		panic(fnerr)
	}
}
func (f decFnInfo) kErr(rv reflect.Value) {
	f.d.errorf("no decoding function defined for kind %v", rv.Kind())
}
func (f decFnInfo) kString(rv reflect.Value) {
	rv.SetString(f.dd.DecodeString())
}
func (f decFnInfo) kBool(rv reflect.Value) {
	rv.SetBool(f.dd.DecodeBool())
}
func (f decFnInfo) kInt(rv reflect.Value) {
	rv.SetInt(f.dd.DecodeInt(intBitsize))
}
func (f decFnInfo) kInt64(rv reflect.Value) {
	rv.SetInt(f.dd.DecodeInt(64))
}
func (f decFnInfo) kInt32(rv reflect.Value) {
	rv.SetInt(f.dd.DecodeInt(32))
}
func (f decFnInfo) kInt8(rv reflect.Value) {
	rv.SetInt(f.dd.DecodeInt(8))
}
func (f decFnInfo) kInt16(rv reflect.Value) {
	rv.SetInt(f.dd.DecodeInt(16))
}
func (f decFnInfo) kFloat32(rv reflect.Value) {
	rv.SetFloat(f.dd.DecodeFloat(true))
}
func (f decFnInfo) kFloat64(rv reflect.Value) {
	rv.SetFloat(f.dd.DecodeFloat(false))
}
func (f decFnInfo) kUint8(rv reflect.Value) {
	rv.SetUint(f.dd.DecodeUint(8))
}
func (f decFnInfo) kUint64(rv reflect.Value) {
	rv.SetUint(f.dd.DecodeUint(64))
}
func (f decFnInfo) kUint(rv reflect.Value) {
	rv.SetUint(f.dd.DecodeUint(uintBitsize))
}
func (f decFnInfo) kUint32(rv reflect.Value) {
	rv.SetUint(f.dd.DecodeUint(32))
}
func (f decFnInfo) kUint16(rv reflect.Value) {
	rv.SetUint(f.dd.DecodeUint(16))
}
func (f decFnInfo) kInterfaceNaked() (rvn reflect.Value) {
	v, vt, decodeFurther := f.dd.DecodeNaked()
	if vt == valueTypeNil {
		return
	}
	if num := f.ti.rt.NumMethod(); num > 0 {
		f.d.errorf("cannot decode non-nil codec value into nil %v (%v methods)", f.ti.rt, num)
		return
	}
	var useRvn bool
	switch vt {
	case valueTypeMap:
		if f.d.h.MapType == nil {
			var m2 map[interface{}]interface{}
			v = &m2
		} else {
			rvn = reflect.New(f.d.h.MapType).Elem()
			useRvn = true
		}
	case valueTypeArray:
		if f.d.h.SliceType == nil {
			var m2 []interface{}
			v = &m2
		} else {
			rvn = reflect.New(f.d.h.SliceType).Elem()
			useRvn = true
		}
	case valueTypeExt:
		re := v.(*RawExt)
		bfn := f.d.h.getExtForTag(re.Tag)
		if bfn == nil {
			re.Data = detachZeroCopyBytes(f.d.bytes, nil, re.Data)
			rvn = reflect.ValueOf(*re)
		} else {
			rvnA := reflect.New(bfn.rt)
			rvn = rvnA.Elem()
			if re.Data != nil {
				bfn.ext.ReadExt(rvnA.Interface(), re.Data)
			} else {
				bfn.ext.UpdateExt(rvnA.Interface(), re.Value)
			}
		}
		return
	}
	if decodeFurther {
		if useRvn {
			f.d.decodeValue(rvn, decFn{})
		} else if v != nil {
			f.d.decode(v)
			rvn = reflect.ValueOf(v).Elem()
			useRvn = true
		}
	}
	if !useRvn && v != nil {
		rvn = reflect.ValueOf(v)
	}
	return
}
func (f decFnInfo) kInterface(rv reflect.Value) {
	if rv.IsNil() {
		rvn := f.kInterfaceNaked()
		if rvn.IsValid() {
			rv.Set(rvn)
		}
	} else {
		rve := rv.Elem()
		if rve.CanSet() {
			f.d.decodeValue(rve, decFn{})
		} else {
			rve2 := reflect.New(rve.Type()).Elem()
			rve2.Set(rve)
			f.d.decodeValue(rve2, decFn{})
			rv.Set(rve2)
		}
	}
}
func (f decFnInfo) kStruct(rv reflect.Value) {
	fti := f.ti
	d := f.d
	if f.dd.IsContainerType(valueTypeMap) {
		containerLen := f.dd.ReadMapStart()
		if containerLen == 0 {
			f.dd.ReadMapEnd()
			return
		}
		tisfi := fti.sfi
		hasLen := containerLen >= 0
		if hasLen {
			for j := 0; j < containerLen; j++ {
				rvkencname := stringView(f.dd.DecodeBytes(f.d.b[:], true, true))
				if k := fti.indexForEncName(rvkencname); k > -1 {
					si := tisfi[k]
					if f.dd.TryDecodeAsNil() {
						si.setToZeroValue(rv)
					} else {
						d.decodeValue(si.field(rv, true), decFn{})
					}
				} else {
					d.structFieldNotFound(-1, rvkencname)
				}
			}
		} else {
			for j := 0; !f.dd.CheckBreak(); j++ {
				if j > 0 {
					f.dd.ReadMapEntrySeparator()
				}
				rvkencname := stringView(f.dd.DecodeBytes(f.d.b[:], true, true))
				f.dd.ReadMapKVSeparator()
				if k := fti.indexForEncName(rvkencname); k > -1 {
					si := tisfi[k]
					if f.dd.TryDecodeAsNil() {
						si.setToZeroValue(rv)
					} else {
						d.decodeValue(si.field(rv, true), decFn{})
					}
				} else {
					d.structFieldNotFound(-1, rvkencname)
				}
			}
			f.dd.ReadMapEnd()
		}
	} else if f.dd.IsContainerType(valueTypeArray) {
		containerLen := f.dd.ReadArrayStart()
		if containerLen == 0 {
			f.dd.ReadArrayEnd()
			return
		}
		hasLen := containerLen >= 0
		for j, si := range fti.sfip {
			if hasLen {
				if j == containerLen {
					break
				}
			} else if f.dd.CheckBreak() {
				break
			}
			if j > 0 {
				f.dd.ReadArrayEntrySeparator()
			}
			if f.dd.TryDecodeAsNil() {
				si.setToZeroValue(rv)
			} else {
				d.decodeValue(si.field(rv, true), decFn{})
			}
		}
		if containerLen > len(fti.sfip) {
			for j := len(fti.sfip); j < containerLen; j++ {
				if j > 0 {
					f.dd.ReadArrayEntrySeparator()
				}
				d.structFieldNotFound(j, "")
			}
		}
		f.dd.ReadArrayEnd()
	} else {
		f.d.error(onlyMapOrArrayCanDecodeIntoStructErr)
		return
	}
}
func (f decFnInfo) kSlice(rv reflect.Value) {
	ti := f.ti
	d := f.d
	if f.dd.IsContainerType(valueTypeBytes) || f.dd.IsContainerType(valueTypeString) {
		if ti.rtid == uint8SliceTypId || ti.rt.Elem().Kind() == reflect.Uint8 {
			if f.seq == seqTypeChan {
				bs2 := f.dd.DecodeBytes(nil, false, true)
				ch := rv.Interface().(chan<- byte)
				for _, b := range bs2 {
					ch <- b
				}
			} else {
				rvbs := rv.Bytes()
				bs2 := f.dd.DecodeBytes(rvbs, false, false)
				if rvbs == nil && bs2 != nil || rvbs != nil && bs2 == nil || len(bs2) != len(rvbs) {
					if rv.CanSet() {
						rv.SetBytes(bs2)
					} else {
						copy(rvbs, bs2)
					}
				}
			}
			return
		}
	}
	slh, containerLenS := d.decSliceHelperStart()
	if rv.IsNil() {
		if f.seq == seqTypeSlice {
			if containerLenS <= 0 {
				rv.Set(reflect.MakeSlice(ti.rt, 0, 0))
			} else {
				rv.Set(reflect.MakeSlice(ti.rt, containerLenS, containerLenS))
			}
		} else if f.seq == seqTypeChan {
			if containerLenS <= 0 {
				rv.Set(reflect.MakeChan(ti.rt, 0))
			} else {
				rv.Set(reflect.MakeChan(ti.rt, containerLenS))
			}
		}
	}
	rvlen := rv.Len()
	if containerLenS == 0 {
		if f.seq == seqTypeSlice && rvlen != 0 {
			rv.SetLen(0)
		}
		return
	}
	rtelem0 := ti.rt.Elem()
	rtelem := rtelem0
	for rtelem.Kind() == reflect.Ptr {
		rtelem = rtelem.Elem()
	}
	fn := d.getDecFn(rtelem, true, true)
	rv0 := rv
	rvChanged := false
	rvcap := rv.Cap()
	hasLen := containerLenS >= 0
	if hasLen {
		if f.seq == seqTypeChan {
			for j := 0; j < containerLenS; j++ {
				rv0 := reflect.New(rtelem0).Elem()
				d.decodeValue(rv0, fn)
				rv.Send(rv0)
			}
		} else {
			numToRead := containerLenS
			if containerLenS > rvcap {
				if f.seq == seqTypeArray {
					d.arrayCannotExpand(rv.Len(), containerLenS)
					numToRead = rvlen
				} else {
					rv = reflect.MakeSlice(ti.rt, containerLenS, containerLenS)
					if rvlen > 0 && !isMutableKind(ti.rt.Kind()) {
						rv1 := rv0
						rv1.SetLen(rvcap)
						reflect.Copy(rv, rv1)
					}
					rvChanged = true
					rvlen = containerLenS
				}
			} else if containerLenS != rvlen {
				if f.seq == seqTypeSlice {
					rv.SetLen(containerLenS)
					rvlen = containerLenS
				}
			}
			j := 0
			for ; j < numToRead; j++ {
				d.decodeValue(rv.Index(j), fn)
			}
			if f.seq == seqTypeArray {
				for ; j < containerLenS; j++ {
					d.swallow()
				}
			}
		}
	} else {
		for j := 0; !f.dd.CheckBreak(); j++ {
			var decodeIntoBlank bool
			if j >= rvlen {
				if f.seq == seqTypeArray {
					d.arrayCannotExpand(rvlen, j+1)
					decodeIntoBlank = true
				} else if f.seq == seqTypeSlice {
					rv = reflect.Append(rv, reflect.Zero(rtelem0))
					rvlen++
					rvChanged = true
				}
			}
			if j > 0 {
				slh.Sep(j)
			}
			if f.seq == seqTypeChan {
				rv0 := reflect.New(rtelem0).Elem()
				d.decodeValue(rv0, fn)
				rv.Send(rv0)
			} else if decodeIntoBlank {
				d.swallow()
			} else {
				d.decodeValue(rv.Index(j), fn)
			}
		}
		slh.End()
	}
	if rvChanged {
		rv0.Set(rv)
	}
}
func (f decFnInfo) kArray(rv reflect.Value) {
	f.kSlice(rv.Slice(0, rv.Len()))
}
func (f decFnInfo) kMap(rv reflect.Value) {
	containerLen := f.dd.ReadMapStart()
	ti := f.ti
	if rv.IsNil() {
		rv.Set(reflect.MakeMap(ti.rt))
	}
	if containerLen == 0 {
		return
	}
	d := f.d
	ktype, vtype := ti.rt.Key(), ti.rt.Elem()
	ktypeId := reflect.ValueOf(ktype).Pointer()
	var keyFn, valFn decFn
	var xtyp reflect.Type
	for xtyp = ktype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() {
	}
	keyFn = d.getDecFn(xtyp, true, true)
	for xtyp = vtype; xtyp.Kind() == reflect.Ptr; xtyp = xtyp.Elem() {
	}
	valFn = d.getDecFn(xtyp, true, true)
	if containerLen > 0 {
		for j := 0; j < containerLen; j++ {
			rvk := reflect.New(ktype).Elem()
			d.decodeValue(rvk, keyFn)
			if ktypeId == intfTypId {
				rvk = rvk.Elem()
				if rvk.Type() == uint8SliceTyp {
					rvk = reflect.ValueOf(string(rvk.Bytes()))
				}
			}
			rvv := rv.MapIndex(rvk)
			if !rvv.IsValid() {
				rvv = reflect.New(vtype).Elem()
			}
			d.decodeValue(rvv, valFn)
			rv.SetMapIndex(rvk, rvv)
		}
	} else {
		for j := 0; !f.dd.CheckBreak(); j++ {
			if j > 0 {
				f.dd.ReadMapEntrySeparator()
			}
			rvk := reflect.New(ktype).Elem()
			d.decodeValue(rvk, keyFn)
			if ktypeId == intfTypId {
				rvk = rvk.Elem()
				if rvk.Type() == uint8SliceTyp {
					rvk = reflect.ValueOf(string(rvk.Bytes()))
				}
			}
			rvv := rv.MapIndex(rvk)
			if !rvv.IsValid() {
				rvv = reflect.New(vtype).Elem()
			}
			f.dd.ReadMapKVSeparator()
			d.decodeValue(rvv, valFn)
			rv.SetMapIndex(rvk, rvv)
		}
		f.dd.ReadMapEnd()
	}
}
type rtidDecFn struct {
	rtid uintptr
	fn   decFn
}
type Decoder struct {
	d decDriver
	r decReader
	s []rtidDecFn
	h *BasicHandle
	rb    bytesDecReader
	hh    Handle
	be    bool  
	bytes bool  
	ri ioDecReader
	f  map[uintptr]decFn
	_  uintptr  
	b [scratchByteArrayLen]byte
}
func NewDecoder(r io.Reader, h Handle) (d *Decoder) {
	d = &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary()}
	d.ri.x = &d.b
	d.ri.bs.r = r
	var ok bool
	d.ri.br, ok = r.(decReaderByteScanner)
	if !ok {
		d.ri.br = &d.ri.bs
	}
	d.r = &d.ri
	d.d = h.newDecDriver(d)
	return
}
func NewDecoderBytes(in []byte, h Handle) (d *Decoder) {
	d = &Decoder{hh: h, h: h.getBasicHandle(), be: h.isBinary(), bytes: true}
	d.rb.b = in
	d.rb.a = len(in)
	d.r = &d.rb
	d.d = h.newDecDriver(d)
	return
}
func (d *Decoder) Decode(v interface{}) (err error) {
	defer panicToErr(&err)
	d.decode(v)
	return
}