1
2
3
4 package custombytesnonstruct
5
6 import (
7 fmt "fmt"
8 _ "github.com/gogo/protobuf/gogoproto"
9 proto "github.com/gogo/protobuf/proto"
10 io "io"
11 math "math"
12 )
13
14
15 var _ = proto.Marshal
16 var _ = fmt.Errorf
17 var _ = math.Inf
18
19
20
21
22
23 const _ = proto.GoGoProtoPackageIsVersion3
24
25 type Object struct {
26 CustomField1 *CustomType `protobuf:"bytes,1,opt,name=CustomField1,customtype=CustomType" json:"CustomField1,omitempty"`
27 CustomField2 []CustomType `protobuf:"bytes,2,rep,name=CustomField2,customtype=CustomType" json:"CustomField2,omitempty"`
28 XXX_NoUnkeyedLiteral struct{} `json:"-"`
29 XXX_unrecognized []byte `json:"-"`
30 XXX_sizecache int32 `json:"-"`
31 }
32
33 func (m *Object) Reset() { *m = Object{} }
34 func (m *Object) String() string { return proto.CompactTextString(m) }
35 func (*Object) ProtoMessage() {}
36 func (*Object) Descriptor() ([]byte, []int) {
37 return fileDescriptor_2fcc84b9998d60d8, []int{0}
38 }
39 func (m *Object) XXX_Unmarshal(b []byte) error {
40 return m.Unmarshal(b)
41 }
42 func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
43 return xxx_messageInfo_Object.Marshal(b, m, deterministic)
44 }
45 func (m *Object) XXX_Merge(src proto.Message) {
46 xxx_messageInfo_Object.Merge(m, src)
47 }
48 func (m *Object) XXX_Size() int {
49 return xxx_messageInfo_Object.Size(m)
50 }
51 func (m *Object) XXX_DiscardUnknown() {
52 xxx_messageInfo_Object.DiscardUnknown(m)
53 }
54
55 var xxx_messageInfo_Object proto.InternalMessageInfo
56
57 func init() {
58 proto.RegisterType((*Object)(nil), "custombytesnonstruct.Object")
59 }
60
61 func init() { proto.RegisterFile("proto.proto", fileDescriptor_2fcc84b9998d60d8) }
62
63 var fileDescriptor_2fcc84b9998d60d8 = []byte{
64
65 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2e, 0x28, 0xca, 0x2f,
66 0xc9, 0xd7, 0x03, 0x93, 0x42, 0x22, 0xc9, 0xa5, 0xc5, 0x25, 0xf9, 0xb9, 0x49, 0x95, 0x25, 0xa9,
67 0xc5, 0x79, 0xf9, 0x79, 0xc5, 0x25, 0x45, 0xa5, 0xc9, 0x25, 0x52, 0xba, 0xe9, 0x99, 0x25, 0x19,
68 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe9, 0xf9, 0xe9, 0xf9, 0xfa, 0x60, 0xc5, 0x49, 0xa5,
69 0x69, 0x60, 0x1e, 0x98, 0x03, 0x66, 0x41, 0x0c, 0x51, 0x2a, 0xe0, 0x62, 0xf3, 0x4f, 0xca, 0x4a,
70 0x4d, 0x2e, 0x11, 0x32, 0xe2, 0xe2, 0x71, 0x06, 0x1b, 0xe8, 0x96, 0x99, 0x9a, 0x93, 0x62, 0x28,
71 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe3, 0xc4, 0x77, 0xeb, 0x9e, 0x3c, 0x17, 0x44, 0x3c, 0xa4, 0xb2,
72 0x20, 0x35, 0x08, 0x45, 0x0d, 0x9a, 0x1e, 0x23, 0x09, 0x26, 0x05, 0x66, 0x02, 0x7a, 0x8c, 0x9c,
73 0x58, 0x2e, 0x3c, 0x92, 0x63, 0x04, 0x04, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xc6, 0xf3, 0xe3, 0xca,
74 0x00, 0x00, 0x00,
75 }
76
77 func (m *Object) Unmarshal(dAtA []byte) error {
78 l := len(dAtA)
79 iNdEx := 0
80 for iNdEx < l {
81 preIndex := iNdEx
82 var wire uint64
83 for shift := uint(0); ; shift += 7 {
84 if shift >= 64 {
85 return ErrIntOverflowProto
86 }
87 if iNdEx >= l {
88 return io.ErrUnexpectedEOF
89 }
90 b := dAtA[iNdEx]
91 iNdEx++
92 wire |= uint64(b&0x7F) << shift
93 if b < 0x80 {
94 break
95 }
96 }
97 fieldNum := int32(wire >> 3)
98 wireType := int(wire & 0x7)
99 if wireType == 4 {
100 return fmt.Errorf("proto: Object: wiretype end group for non-group")
101 }
102 if fieldNum <= 0 {
103 return fmt.Errorf("proto: Object: illegal tag %d (wire type %d)", fieldNum, wire)
104 }
105 switch fieldNum {
106 case 1:
107 if wireType != 2 {
108 return fmt.Errorf("proto: wrong wireType = %d for field CustomField1", wireType)
109 }
110 var byteLen int
111 for shift := uint(0); ; shift += 7 {
112 if shift >= 64 {
113 return ErrIntOverflowProto
114 }
115 if iNdEx >= l {
116 return io.ErrUnexpectedEOF
117 }
118 b := dAtA[iNdEx]
119 iNdEx++
120 byteLen |= int(b&0x7F) << shift
121 if b < 0x80 {
122 break
123 }
124 }
125 if byteLen < 0 {
126 return ErrInvalidLengthProto
127 }
128 postIndex := iNdEx + byteLen
129 if postIndex < 0 {
130 return ErrInvalidLengthProto
131 }
132 if postIndex > l {
133 return io.ErrUnexpectedEOF
134 }
135 var v CustomType
136 m.CustomField1 = &v
137 if err := m.CustomField1.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
138 return err
139 }
140 iNdEx = postIndex
141 case 2:
142 if wireType != 2 {
143 return fmt.Errorf("proto: wrong wireType = %d for field CustomField2", wireType)
144 }
145 var byteLen int
146 for shift := uint(0); ; shift += 7 {
147 if shift >= 64 {
148 return ErrIntOverflowProto
149 }
150 if iNdEx >= l {
151 return io.ErrUnexpectedEOF
152 }
153 b := dAtA[iNdEx]
154 iNdEx++
155 byteLen |= int(b&0x7F) << shift
156 if b < 0x80 {
157 break
158 }
159 }
160 if byteLen < 0 {
161 return ErrInvalidLengthProto
162 }
163 postIndex := iNdEx + byteLen
164 if postIndex < 0 {
165 return ErrInvalidLengthProto
166 }
167 if postIndex > l {
168 return io.ErrUnexpectedEOF
169 }
170 var v CustomType
171 m.CustomField2 = append(m.CustomField2, v)
172 if err := m.CustomField2[len(m.CustomField2)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
173 return err
174 }
175 iNdEx = postIndex
176 default:
177 iNdEx = preIndex
178 skippy, err := skipProto(dAtA[iNdEx:])
179 if err != nil {
180 return err
181 }
182 if (skippy < 0) || (iNdEx+skippy) < 0 {
183 return ErrInvalidLengthProto
184 }
185 if (iNdEx + skippy) > l {
186 return io.ErrUnexpectedEOF
187 }
188 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
189 iNdEx += skippy
190 }
191 }
192
193 if iNdEx > l {
194 return io.ErrUnexpectedEOF
195 }
196 return nil
197 }
198 func skipProto(dAtA []byte) (n int, err error) {
199 l := len(dAtA)
200 iNdEx := 0
201 depth := 0
202 for iNdEx < l {
203 var wire uint64
204 for shift := uint(0); ; shift += 7 {
205 if shift >= 64 {
206 return 0, ErrIntOverflowProto
207 }
208 if iNdEx >= l {
209 return 0, io.ErrUnexpectedEOF
210 }
211 b := dAtA[iNdEx]
212 iNdEx++
213 wire |= (uint64(b) & 0x7F) << shift
214 if b < 0x80 {
215 break
216 }
217 }
218 wireType := int(wire & 0x7)
219 switch wireType {
220 case 0:
221 for shift := uint(0); ; shift += 7 {
222 if shift >= 64 {
223 return 0, ErrIntOverflowProto
224 }
225 if iNdEx >= l {
226 return 0, io.ErrUnexpectedEOF
227 }
228 iNdEx++
229 if dAtA[iNdEx-1] < 0x80 {
230 break
231 }
232 }
233 case 1:
234 iNdEx += 8
235 case 2:
236 var length int
237 for shift := uint(0); ; shift += 7 {
238 if shift >= 64 {
239 return 0, ErrIntOverflowProto
240 }
241 if iNdEx >= l {
242 return 0, io.ErrUnexpectedEOF
243 }
244 b := dAtA[iNdEx]
245 iNdEx++
246 length |= (int(b) & 0x7F) << shift
247 if b < 0x80 {
248 break
249 }
250 }
251 if length < 0 {
252 return 0, ErrInvalidLengthProto
253 }
254 iNdEx += length
255 case 3:
256 depth++
257 case 4:
258 if depth == 0 {
259 return 0, ErrUnexpectedEndOfGroupProto
260 }
261 depth--
262 case 5:
263 iNdEx += 4
264 default:
265 return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
266 }
267 if iNdEx < 0 {
268 return 0, ErrInvalidLengthProto
269 }
270 if depth == 0 {
271 return iNdEx, nil
272 }
273 }
274 return 0, io.ErrUnexpectedEOF
275 }
276
277 var (
278 ErrInvalidLengthProto = fmt.Errorf("proto: negative length found during unmarshaling")
279 ErrIntOverflowProto = fmt.Errorf("proto: integer overflow")
280 ErrUnexpectedEndOfGroupProto = fmt.Errorf("proto: unexpected end of group")
281 )
282
View as plain text