func (s *Scanner) readType() (plumbing.ObjectType, byte, error) { var c byte var err error if c, err = s.r.ReadByte(); err != nil { return plumbing.ObjectType(0), 0, err } typ := parseType(c) return typ, c, nil }
func parseType(b byte) plumbing.ObjectType { return plumbing.ObjectType((b & maskType) >> firstLengthBits) }