build: Upgrade github.com/gogo/protobuf (#5994)

This is the result of:

- Changing build.go to take the protobuf version from the modules
  instead of hardcoded
- `go get github.com/gogo/protobuf@v1.3.0` to upgrade
- `go run build.go proto` to regenerate our code
This commit is contained in:
Jakob Borg
2019-09-04 07:33:29 +01:00
committed by GitHub
parent e945e65b13
commit 80894948f6
8 changed files with 1789 additions and 1327 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,12 +3,14 @@
package protocol
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import io "io"
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
@@ -19,7 +21,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type TestOldDeviceID struct {
Test []byte `protobuf:"bytes,1,opt,name=test,proto3" json:"test,omitempty"`
@@ -29,7 +31,7 @@ func (m *TestOldDeviceID) Reset() { *m = TestOldDeviceID{} }
func (m *TestOldDeviceID) String() string { return proto.CompactTextString(m) }
func (*TestOldDeviceID) ProtoMessage() {}
func (*TestOldDeviceID) Descriptor() ([]byte, []int) {
return fileDescriptor_deviceid_test_36bcb89b605bdafe, []int{0}
return fileDescriptor_a5b590761a4231d0, []int{0}
}
func (m *TestOldDeviceID) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -39,15 +41,15 @@ func (m *TestOldDeviceID) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_TestOldDeviceID.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *TestOldDeviceID) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestOldDeviceID.Merge(dst, src)
func (m *TestOldDeviceID) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestOldDeviceID.Merge(m, src)
}
func (m *TestOldDeviceID) XXX_Size() int {
return m.ProtoSize()
@@ -66,7 +68,7 @@ func (m *TestNewDeviceID) Reset() { *m = TestNewDeviceID{} }
func (m *TestNewDeviceID) String() string { return proto.CompactTextString(m) }
func (*TestNewDeviceID) ProtoMessage() {}
func (*TestNewDeviceID) Descriptor() ([]byte, []int) {
return fileDescriptor_deviceid_test_36bcb89b605bdafe, []int{1}
return fileDescriptor_a5b590761a4231d0, []int{1}
}
func (m *TestNewDeviceID) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@@ -76,15 +78,15 @@ func (m *TestNewDeviceID) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return xxx_messageInfo_TestNewDeviceID.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalTo(b)
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (dst *TestNewDeviceID) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestNewDeviceID.Merge(dst, src)
func (m *TestNewDeviceID) XXX_Merge(src proto.Message) {
xxx_messageInfo_TestNewDeviceID.Merge(m, src)
}
func (m *TestNewDeviceID) XXX_Size() int {
return m.ProtoSize()
@@ -99,10 +101,29 @@ func init() {
proto.RegisterType((*TestOldDeviceID)(nil), "protocol.TestOldDeviceID")
proto.RegisterType((*TestNewDeviceID)(nil), "protocol.TestNewDeviceID")
}
func init() { proto.RegisterFile("deviceid_test.proto", fileDescriptor_a5b590761a4231d0) }
var fileDescriptor_a5b590761a4231d0 = []byte{
// 182 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x49, 0x2d, 0xcb,
0x4c, 0x4e, 0xcd, 0x4c, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0xe2, 0x00, 0x53, 0xc9, 0xf9, 0x39, 0x52, 0xca, 0x45, 0xa9, 0x05, 0xf9, 0xc5, 0xfa, 0x60, 0x7e,
0x52, 0x69, 0x9a, 0x7e, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0x03, 0x66, 0x41, 0x94, 0x2b, 0xa9, 0x72,
0xf1, 0x87, 0xa4, 0x16, 0x97, 0xf8, 0xe7, 0xa4, 0xb8, 0x80, 0x0d, 0xf3, 0x74, 0x11, 0x12, 0xe2,
0x62, 0x01, 0x99, 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x66, 0x2b, 0x99, 0x43, 0x94,
0xf9, 0xa5, 0x96, 0xc3, 0x95, 0xa9, 0x20, 0x2b, 0x73, 0x12, 0x38, 0x71, 0x4f, 0x9e, 0xe1, 0xd6,
0x3d, 0x79, 0x0e, 0x98, 0x3c, 0x44, 0xa3, 0x93, 0xc6, 0x89, 0x87, 0x72, 0x0c, 0x17, 0x1e, 0xca,
0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x0c, 0x2f, 0x1e,
0xc9, 0x31, 0x4c, 0x78, 0x2c, 0xc7, 0xb0, 0xe0, 0xb1, 0x1c, 0xe3, 0x85, 0xc7, 0x72, 0x0c, 0x37,
0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0x1d, 0x64, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x96,
0x3e, 0xc0, 0xd6, 0x00, 0x00, 0x00,
}
func (m *TestOldDeviceID) Marshal() (dAtA []byte, err error) {
size := m.ProtoSize()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
@@ -110,23 +131,29 @@ func (m *TestOldDeviceID) Marshal() (dAtA []byte, err error) {
}
func (m *TestOldDeviceID) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.ProtoSize()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TestOldDeviceID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Test) > 0 {
dAtA[i] = 0xa
i++
i -= len(m.Test)
copy(dAtA[i:], m.Test)
i = encodeVarintDeviceidTest(dAtA, i, uint64(len(m.Test)))
i += copy(dAtA[i:], m.Test)
i--
dAtA[i] = 0xa
}
return i, nil
return len(dAtA) - i, nil
}
func (m *TestNewDeviceID) Marshal() (dAtA []byte, err error) {
size := m.ProtoSize()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
@@ -134,29 +161,38 @@ func (m *TestNewDeviceID) Marshal() (dAtA []byte, err error) {
}
func (m *TestNewDeviceID) MarshalTo(dAtA []byte) (int, error) {
var i int
size := m.ProtoSize()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *TestNewDeviceID) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintDeviceidTest(dAtA, i, uint64(m.Test.ProtoSize()))
n1, err := m.Test.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
{
size := m.Test.ProtoSize()
i -= size
if _, err := m.Test.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintDeviceidTest(dAtA, i, uint64(size))
}
i += n1
return i, nil
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
func encodeVarintDeviceidTest(dAtA []byte, offset int, v uint64) int {
offset -= sovDeviceidTest(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
return base
}
func (m *TestOldDeviceID) ProtoSize() (n int) {
if m == nil {
@@ -183,14 +219,7 @@ func (m *TestNewDeviceID) ProtoSize() (n int) {
}
func sovDeviceidTest(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
return (math_bits.Len64(x|1) + 6) / 7
}
func sozDeviceidTest(x uint64) (n int) {
return sovDeviceidTest(uint64((x << 1) ^ uint64((int64(x) >> 63))))
@@ -210,7 +239,7 @@ func (m *TestOldDeviceID) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -238,7 +267,7 @@ func (m *TestOldDeviceID) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= (int(b) & 0x7F) << shift
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -247,6 +276,9 @@ func (m *TestOldDeviceID) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthDeviceidTest
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthDeviceidTest
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
@@ -264,6 +296,9 @@ func (m *TestOldDeviceID) Unmarshal(dAtA []byte) error {
if skippy < 0 {
return ErrInvalidLengthDeviceidTest
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDeviceidTest
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
@@ -291,7 +326,7 @@ func (m *TestNewDeviceID) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -319,7 +354,7 @@ func (m *TestNewDeviceID) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= (int(b) & 0x7F) << shift
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
@@ -328,6 +363,9 @@ func (m *TestNewDeviceID) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthDeviceidTest
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return ErrInvalidLengthDeviceidTest
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
@@ -344,6 +382,9 @@ func (m *TestNewDeviceID) Unmarshal(dAtA []byte) error {
if skippy < 0 {
return ErrInvalidLengthDeviceidTest
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDeviceidTest
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
@@ -410,10 +451,13 @@ func skipDeviceidTest(dAtA []byte) (n int, err error) {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthDeviceidTest
}
iNdEx += length
if iNdEx < 0 {
return 0, ErrInvalidLengthDeviceidTest
}
return iNdEx, nil
case 3:
for {
@@ -442,6 +486,9 @@ func skipDeviceidTest(dAtA []byte) (n int, err error) {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthDeviceidTest
}
}
return iNdEx, nil
case 4:
@@ -460,21 +507,3 @@ var (
ErrInvalidLengthDeviceidTest = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowDeviceidTest = fmt.Errorf("proto: integer overflow")
)
func init() { proto.RegisterFile("deviceid_test.proto", fileDescriptor_deviceid_test_36bcb89b605bdafe) }
var fileDescriptor_deviceid_test_36bcb89b605bdafe = []byte{
// 182 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4e, 0x49, 0x2d, 0xcb,
0x4c, 0x4e, 0xcd, 0x4c, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
0xe2, 0x00, 0x53, 0xc9, 0xf9, 0x39, 0x52, 0xca, 0x45, 0xa9, 0x05, 0xf9, 0xc5, 0xfa, 0x60, 0x7e,
0x52, 0x69, 0x9a, 0x7e, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0x03, 0x66, 0x41, 0x94, 0x2b, 0xa9, 0x72,
0xf1, 0x87, 0xa4, 0x16, 0x97, 0xf8, 0xe7, 0xa4, 0xb8, 0x80, 0x0d, 0xf3, 0x74, 0x11, 0x12, 0xe2,
0x62, 0x01, 0x99, 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x66, 0x2b, 0x99, 0x43, 0x94,
0xf9, 0xa5, 0x96, 0xc3, 0x95, 0xa9, 0x20, 0x2b, 0x73, 0x12, 0x38, 0x71, 0x4f, 0x9e, 0xe1, 0xd6,
0x3d, 0x79, 0x0e, 0x98, 0x3c, 0x44, 0xa3, 0x93, 0xc6, 0x89, 0x87, 0x72, 0x0c, 0x17, 0x1e, 0xca,
0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x0c, 0x2f, 0x1e,
0xc9, 0x31, 0x4c, 0x78, 0x2c, 0xc7, 0xb0, 0xe0, 0xb1, 0x1c, 0xe3, 0x85, 0xc7, 0x72, 0x0c, 0x37,
0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0x1d, 0x64, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xe3, 0x96,
0x3e, 0xc0, 0xd6, 0x00, 0x00, 0x00,
}