cmd/aminoscan/aminoscan.go
func slide(bzPtr *[]byte, n *int, _n int) bool {
	if len(*bzPtr) < _n {
		panic("eof")
	}
	*bzPtr = (*bzPtr)[_n:]
	*n += _n
	return true
}
func slide(bzPtr *[]byte, n *int, _n int) bool {
	if len(*bzPtr) < _n {
		panic("eof")
	}
	*bzPtr = (*bzPtr)[_n:]
	*n += _n
	return true
}
/*
func scanList(bz []byte, indent string) (s string, n int, err error) {
	// Read element Typ4.
	if len(bz) < 1 {
		err = errors.New("EOF while reading list element typ4.")
		return
	}
	var typ = amino.Typ4(bz[0])
	if typ&0xF0 > 0 {
		err = errors.New("Invalid list element typ4 byte")
	}
	s = fmt.Sprintf("%X", bz[:1])
	if slide(&bz, &n, 1) && err != nil {
		return
	}
	// Read number of elements.
	var num, _n = uint64(0), int(0)
	num, _n = binary.Uvarint(bz)
	if _n < 0 {
		_n = 0
		err = errors.New("error decoding list length (uvarint)")
	}
	s += Cyan(fmt.Sprintf("%X", bz[:_n]))
	if slide(&bz, &n, _n) && err != nil {
		return
	}
	fmt.Printf("%s%s of %v with %v items\n", indent, s, typ, num)
	// Read elements.
	var _s string
	for i := 0; i < int(num); i++ {
		// Maybe read nil byte.
		if typ&0x08 != 0 {
			if len(bz) == 0 {
				err = errors.New("EOF while reading list nil byte")
				return
			}
			var nb = bz[0]
			slide(&bz, &n, 1)
			switch nb {
			case 0x00:
				s += "00"
				fmt.Printf("%s00 (not nil)\n", indent)
			case 0x01:
				s += "01" // Is nil (NOTE: reverse logic)
				fmt.Printf("%s01 (is nil)\n", indent)
				continue
			default:
				err = fmt.Errorf("Unexpected nil pointer byte %X", nb)
				return
			}
		}
		// Read element.
		_s, _n, err = scanAny(typ.Typ3(), bz, indent+"  ")
		if slide(&bz, &n, _n) && concat(&s, _s) && err != nil {
			return
		}
	}
	return
}
*/
/*
func scanInterface(bz []byte, indent string) (s string, n int, err error) {
	db, hasDb, pb, typ, _, isNil, _n, err := amino.DecodeDisambPrefixBytes(bz)
	if slide(&bz, &n, _n) && err != nil {
		return
	}
	pb3 := pb
	if isNil {
		s = Magenta("0000")
	} else if hasDb {
		s = Magenta(fmt.Sprintf("%X%X", db.Bytes(), pb3.Bytes()))
	} else {
		s = Magenta(fmt.Sprintf("%X", pb3.Bytes()))
	}
	if isNil {
		fmt.Printf("%s%s (nil interface)\n", indent, s)
	} else if hasDb {
		fmt.Printf("%s%s (disamb: %X, prefix: %X, typ: %v)\n",
			indent, s, db.Bytes(), pb.Bytes(), typ)
	} else {
		fmt.Printf("%s%s (prefix: %X, typ: %v)\n",
			indent, s, pb.Bytes(), typ)
	}
	_s, _n, err := scanAny(typ, bz, indent)
	if slide(&bz, &n, _n) && concat(&s, _s) && err != nil {
		return
	}
	return
}
*/
//----------------------------------------
// Misc.