github.com/gogo/protobuf@v1.3.2/test/issue620/issue620.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: issue620.proto 3 4 package issue620 5 6 import ( 7 bytes "bytes" 8 fmt "fmt" 9 _ "github.com/gogo/protobuf/gogoproto" 10 proto "github.com/gogo/protobuf/proto" 11 math "math" 12 math_bits "math/bits" 13 ) 14 15 // Reference imports to suppress errors if they are not otherwise used. 16 var _ = proto.Marshal 17 var _ = fmt.Errorf 18 var _ = math.Inf 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the proto package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // proto package needs to be updated. 24 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 25 26 type Bar struct { 27 Field1 *string `protobuf:"bytes,1,opt,name=Field1" json:"Field1,omitempty"` 28 XXX_NoUnkeyedLiteral struct{} `json:"-"` 29 XXX_unrecognized []byte `json:"-"` 30 XXX_sizecache int32 `json:"-"` 31 } 32 33 func (m *Bar) Reset() { *m = Bar{} } 34 func (m *Bar) String() string { return proto.CompactTextString(m) } 35 func (*Bar) ProtoMessage() {} 36 func (*Bar) Descriptor() ([]byte, []int) { 37 return fileDescriptor_63df3af46ac96f83, []int{0} 38 } 39 func (m *Bar) XXX_Unmarshal(b []byte) error { 40 return xxx_messageInfo_Bar.Unmarshal(m, b) 41 } 42 func (m *Bar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 43 return xxx_messageInfo_Bar.Marshal(b, m, deterministic) 44 } 45 func (m *Bar) XXX_Merge(src proto.Message) { 46 xxx_messageInfo_Bar.Merge(m, src) 47 } 48 func (m *Bar) XXX_Size() int { 49 return xxx_messageInfo_Bar.Size(m) 50 } 51 func (m *Bar) XXX_DiscardUnknown() { 52 xxx_messageInfo_Bar.DiscardUnknown(m) 53 } 54 55 var xxx_messageInfo_Bar proto.InternalMessageInfo 56 57 func (m *Bar) GetField1() string { 58 if m != nil && m.Field1 != nil { 59 return *m.Field1 60 } 61 return "" 62 } 63 64 type BarFast struct { 65 Field1 *string `protobuf:"bytes,1,opt,name=Field1" json:"Field1,omitempty"` 66 XXX_NoUnkeyedLiteral struct{} `json:"-"` 67 XXX_unrecognized []byte `json:"-"` 68 XXX_sizecache int32 `json:"-"` 69 } 70 71 func (m *BarFast) Reset() { *m = BarFast{} } 72 func (m *BarFast) String() string { return proto.CompactTextString(m) } 73 func (*BarFast) ProtoMessage() {} 74 func (*BarFast) Descriptor() ([]byte, []int) { 75 return fileDescriptor_63df3af46ac96f83, []int{1} 76 } 77 func (m *BarFast) XXX_Unmarshal(b []byte) error { 78 return xxx_messageInfo_BarFast.Unmarshal(m, b) 79 } 80 func (m *BarFast) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 81 if deterministic { 82 return xxx_messageInfo_BarFast.Marshal(b, m, deterministic) 83 } else { 84 b = b[:cap(b)] 85 n, err := m.MarshalToSizedBuffer(b) 86 if err != nil { 87 return nil, err 88 } 89 return b[:n], nil 90 } 91 } 92 func (m *BarFast) XXX_Merge(src proto.Message) { 93 xxx_messageInfo_BarFast.Merge(m, src) 94 } 95 func (m *BarFast) XXX_Size() int { 96 return m.Size() 97 } 98 func (m *BarFast) XXX_DiscardUnknown() { 99 xxx_messageInfo_BarFast.DiscardUnknown(m) 100 } 101 102 var xxx_messageInfo_BarFast proto.InternalMessageInfo 103 104 func (m *BarFast) GetField1() string { 105 if m != nil && m.Field1 != nil { 106 return *m.Field1 107 } 108 return "" 109 } 110 111 func init() { 112 proto.RegisterType((*Bar)(nil), "issue620.Bar") 113 proto.RegisterType((*BarFast)(nil), "issue620.BarFast") 114 } 115 116 func init() { proto.RegisterFile("issue620.proto", fileDescriptor_63df3af46ac96f83) } 117 118 var fileDescriptor_63df3af46ac96f83 = []byte{ 119 // 128 bytes of a gzipped FileDescriptorProto 120 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x2c, 0x2e, 0x2e, 121 0x4d, 0x35, 0x33, 0x32, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74, 122 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5, 123 0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x54, 0x92, 0xe5, 0x62, 124 0x76, 0x4a, 0x2c, 0x12, 0x12, 0xe3, 0x62, 0x73, 0xcb, 0x4c, 0xcd, 0x49, 0x31, 0x94, 0x60, 0x54, 125 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf2, 0x94, 0xf4, 0xb9, 0xd8, 0x9d, 0x12, 0x8b, 0xdc, 0x12, 0x8b, 126 0x4b, 0x70, 0x29, 0xb1, 0xe2, 0x79, 0xb1, 0x40, 0x9e, 0xb1, 0x63, 0xa1, 0x3c, 0xe3, 0x82, 0x85, 127 0xf2, 0x8c, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x36, 0x1c, 0x6d, 0xdf, 0x99, 0x00, 0x00, 0x00, 128 } 129 130 func (this *BarFast) Equal(that interface{}) bool { 131 if that == nil { 132 return this == nil 133 } 134 135 that1, ok := that.(*BarFast) 136 if !ok { 137 that2, ok := that.(BarFast) 138 if ok { 139 that1 = &that2 140 } else { 141 return false 142 } 143 } 144 if that1 == nil { 145 return this == nil 146 } else if this == nil { 147 return false 148 } 149 if this.Field1 != nil && that1.Field1 != nil { 150 if *this.Field1 != *that1.Field1 { 151 return false 152 } 153 } else if this.Field1 != nil { 154 return false 155 } else if that1.Field1 != nil { 156 return false 157 } 158 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { 159 return false 160 } 161 return true 162 } 163 func (m *BarFast) Marshal() (dAtA []byte, err error) { 164 size := m.Size() 165 dAtA = make([]byte, size) 166 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 167 if err != nil { 168 return nil, err 169 } 170 return dAtA[:n], nil 171 } 172 173 func (m *BarFast) MarshalTo(dAtA []byte) (int, error) { 174 size := m.Size() 175 return m.MarshalToSizedBuffer(dAtA[:size]) 176 } 177 178 func (m *BarFast) MarshalToSizedBuffer(dAtA []byte) (int, error) { 179 i := len(dAtA) 180 _ = i 181 var l int 182 _ = l 183 if m.XXX_unrecognized != nil { 184 i -= len(m.XXX_unrecognized) 185 copy(dAtA[i:], m.XXX_unrecognized) 186 } 187 if m.Field1 != nil { 188 i -= len(*m.Field1) 189 copy(dAtA[i:], *m.Field1) 190 i = encodeVarintIssue620(dAtA, i, uint64(len(*m.Field1))) 191 i-- 192 dAtA[i] = 0xa 193 } 194 return len(dAtA) - i, nil 195 } 196 197 func encodeVarintIssue620(dAtA []byte, offset int, v uint64) int { 198 offset -= sovIssue620(v) 199 base := offset 200 for v >= 1<<7 { 201 dAtA[offset] = uint8(v&0x7f | 0x80) 202 v >>= 7 203 offset++ 204 } 205 dAtA[offset] = uint8(v) 206 return base 207 } 208 func (m *BarFast) Size() (n int) { 209 if m == nil { 210 return 0 211 } 212 var l int 213 _ = l 214 if m.Field1 != nil { 215 l = len(*m.Field1) 216 n += 1 + l + sovIssue620(uint64(l)) 217 } 218 if m.XXX_unrecognized != nil { 219 n += len(m.XXX_unrecognized) 220 } 221 return n 222 } 223 224 func sovIssue620(x uint64) (n int) { 225 return (math_bits.Len64(x|1) + 6) / 7 226 } 227 func sozIssue620(x uint64) (n int) { 228 return sovIssue620(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 229 }