func (m *Foo) Unmarshal(data []byte) error { l := len(data) index := 0 for index < l { var wire uint64 for shift := uint(0); ; shift += 7 { if index >= l { return io.ErrUnexpectedEOF } b := data[index] index++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Bar", wireType) } var v uint64 for shift := uint(0); ; shift += 7 { if index >= l { return io.ErrUnexpectedEOF } b := data[index] index++ v |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } m.Bar = &v default: var sizeOfWire int for { sizeOfWire++ wire >>= 7 if wire == 0 { break } } index -= sizeOfWire skippy, err := dropbox_gogoprotobuf_proto.Skip(data[index:]) if err != nil { return err } if (index + skippy) > l { return io.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) index += skippy } } return nil }
func (m *BigUnsafe) Unmarshal(data []byte) error { l := len(data) index := 0 for index < l { var wire uint64 for shift := uint(0); ; shift += 7 { if index >= l { return io1.ErrUnexpectedEOF } b := data[index] index++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) switch fieldNum { case 1: if wireType != 2 { return fmt1.Errorf("proto: wrong wireType = %d for field Sub", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if index >= l { return io1.ErrUnexpectedEOF } b := data[index] index++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } postIndex := index + msglen if postIndex > l { return io1.ErrUnexpectedEOF } if m.Sub == nil { m.Sub = &Sub{} } if err := m.Sub.Unmarshal(data[index:postIndex]); err != nil { return err } index = postIndex case 2: if wireType != 0 { return fmt1.Errorf("proto: wrong wireType = %d for field Number", wireType) } var v int64 for shift := uint(0); ; shift += 7 { if index >= l { return io1.ErrUnexpectedEOF } b := data[index] index++ v |= (int64(b) & 0x7F) << shift if b < 0x80 { break } } m.Number = &v default: var sizeOfWire int for { sizeOfWire++ wire >>= 7 if wire == 0 { break } } index -= sizeOfWire skippy, err := dropbox_gogoprotobuf_proto1.Skip(data[index:]) if err != nil { return err } if (index + skippy) > l { return io1.ErrUnexpectedEOF } m.XXX_unrecognized = append(m.XXX_unrecognized, data[index:index+skippy]...) index += skippy } } return nil }