github.com/gogo/protobuf@v1.3.2/test/issue262/timefail.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: timefail.proto 3 4 package timefail 5 6 import ( 7 fmt "fmt" 8 _ "github.com/gogo/protobuf/gogoproto" 9 proto "github.com/gogo/protobuf/proto" 10 _ "github.com/gogo/protobuf/types" 11 github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" 12 io "io" 13 math "math" 14 math_bits "math/bits" 15 reflect "reflect" 16 strings "strings" 17 time "time" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = fmt.Errorf 23 var _ = math.Inf 24 var _ = time.Kitchen 25 26 // This is a compile-time assertion to ensure that this generated file 27 // is compatible with the proto package it is being compiled against. 28 // A compilation error at this line likely means your copy of the 29 // proto package needs to be updated. 30 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 31 32 type TimeFail struct { 33 TimeTest *time.Time `protobuf:"bytes,1,opt,name=time_test,json=timeTest,proto3,stdtime" json:"time_test,omitempty"` 34 } 35 36 func (m *TimeFail) Reset() { *m = TimeFail{} } 37 func (*TimeFail) ProtoMessage() {} 38 func (*TimeFail) Descriptor() ([]byte, []int) { 39 return fileDescriptor_395e61815f86626a, []int{0} 40 } 41 func (m *TimeFail) XXX_Unmarshal(b []byte) error { 42 return m.Unmarshal(b) 43 } 44 func (m *TimeFail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 45 if deterministic { 46 return xxx_messageInfo_TimeFail.Marshal(b, m, deterministic) 47 } else { 48 b = b[:cap(b)] 49 n, err := m.MarshalToSizedBuffer(b) 50 if err != nil { 51 return nil, err 52 } 53 return b[:n], nil 54 } 55 } 56 func (m *TimeFail) XXX_Merge(src proto.Message) { 57 xxx_messageInfo_TimeFail.Merge(m, src) 58 } 59 func (m *TimeFail) XXX_Size() int { 60 return m.Size() 61 } 62 func (m *TimeFail) XXX_DiscardUnknown() { 63 xxx_messageInfo_TimeFail.DiscardUnknown(m) 64 } 65 66 var xxx_messageInfo_TimeFail proto.InternalMessageInfo 67 68 func (m *TimeFail) GetTimeTest() *time.Time { 69 if m != nil { 70 return m.TimeTest 71 } 72 return nil 73 } 74 75 func init() { 76 proto.RegisterType((*TimeFail)(nil), "timefail.TimeFail") 77 } 78 79 func init() { proto.RegisterFile("timefail.proto", fileDescriptor_395e61815f86626a) } 80 81 var fileDescriptor_395e61815f86626a = []byte{ 82 // 210 bytes of a gzipped FileDescriptorProto 83 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2b, 0xc9, 0xcc, 0x4d, 84 0x4d, 0x4b, 0xcc, 0xcc, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74, 85 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5, 86 0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x94, 0x92, 0x4f, 0xcf, 87 0xcf, 0x4f, 0xcf, 0x49, 0x45, 0xa8, 0x02, 0x19, 0x54, 0x5c, 0x92, 0x98, 0x5b, 0x00, 0x51, 0xa0, 88 0xe4, 0xc9, 0xc5, 0x11, 0x92, 0x99, 0x9b, 0xea, 0x96, 0x98, 0x99, 0x23, 0x64, 0xcb, 0xc5, 0x09, 89 0x92, 0x8e, 0x2f, 0x49, 0x2d, 0x2e, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd2, 0x83, 90 0x18, 0xa0, 0x07, 0x33, 0x40, 0x2f, 0x04, 0x66, 0x80, 0x13, 0xcb, 0x84, 0xfb, 0xf2, 0x8c, 0x41, 91 0x60, 0xa7, 0x85, 0xa4, 0x16, 0x97, 0x38, 0x99, 0x5c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 92 0xc3, 0x87, 0x87, 0x72, 0x8c, 0x0d, 0x8f, 0xe4, 0x18, 0x57, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 93 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x5f, 0x3c, 0x92, 0x63, 0xf8, 0xf0, 94 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x48, 95 0x62, 0x03, 0x9b, 0x6c, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x43, 0x63, 0x18, 0x5f, 0xf3, 0x00, 96 0x00, 0x00, 97 } 98 99 func (this *TimeFail) Equal(that interface{}) bool { 100 if that == nil { 101 return this == nil 102 } 103 104 that1, ok := that.(*TimeFail) 105 if !ok { 106 that2, ok := that.(TimeFail) 107 if ok { 108 that1 = &that2 109 } else { 110 return false 111 } 112 } 113 if that1 == nil { 114 return this == nil 115 } else if this == nil { 116 return false 117 } 118 if that1.TimeTest == nil { 119 if this.TimeTest != nil { 120 return false 121 } 122 } else if !this.TimeTest.Equal(*that1.TimeTest) { 123 return false 124 } 125 return true 126 } 127 func (this *TimeFail) GoString() string { 128 if this == nil { 129 return "nil" 130 } 131 s := make([]string, 0, 5) 132 s = append(s, "&timefail.TimeFail{") 133 s = append(s, "TimeTest: "+fmt.Sprintf("%#v", this.TimeTest)+",\n") 134 s = append(s, "}") 135 return strings.Join(s, "") 136 } 137 func valueToGoStringTimefail(v interface{}, typ string) string { 138 rv := reflect.ValueOf(v) 139 if rv.IsNil() { 140 return "nil" 141 } 142 pv := reflect.Indirect(rv).Interface() 143 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 144 } 145 func (m *TimeFail) Marshal() (dAtA []byte, err error) { 146 size := m.Size() 147 dAtA = make([]byte, size) 148 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 149 if err != nil { 150 return nil, err 151 } 152 return dAtA[:n], nil 153 } 154 155 func (m *TimeFail) MarshalTo(dAtA []byte) (int, error) { 156 size := m.Size() 157 return m.MarshalToSizedBuffer(dAtA[:size]) 158 } 159 160 func (m *TimeFail) MarshalToSizedBuffer(dAtA []byte) (int, error) { 161 i := len(dAtA) 162 _ = i 163 var l int 164 _ = l 165 if m.TimeTest != nil { 166 n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.TimeTest, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.TimeTest):]) 167 if err1 != nil { 168 return 0, err1 169 } 170 i -= n1 171 i = encodeVarintTimefail(dAtA, i, uint64(n1)) 172 i-- 173 dAtA[i] = 0xa 174 } 175 return len(dAtA) - i, nil 176 } 177 178 func encodeVarintTimefail(dAtA []byte, offset int, v uint64) int { 179 offset -= sovTimefail(v) 180 base := offset 181 for v >= 1<<7 { 182 dAtA[offset] = uint8(v&0x7f | 0x80) 183 v >>= 7 184 offset++ 185 } 186 dAtA[offset] = uint8(v) 187 return base 188 } 189 func (m *TimeFail) Size() (n int) { 190 if m == nil { 191 return 0 192 } 193 var l int 194 _ = l 195 if m.TimeTest != nil { 196 l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.TimeTest) 197 n += 1 + l + sovTimefail(uint64(l)) 198 } 199 return n 200 } 201 202 func sovTimefail(x uint64) (n int) { 203 return (math_bits.Len64(x|1) + 6) / 7 204 } 205 func sozTimefail(x uint64) (n int) { 206 return sovTimefail(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 207 } 208 func (this *TimeFail) String() string { 209 if this == nil { 210 return "nil" 211 } 212 s := strings.Join([]string{`&TimeFail{`, 213 `TimeTest:` + strings.Replace(fmt.Sprintf("%v", this.TimeTest), "Timestamp", "types.Timestamp", 1) + `,`, 214 `}`, 215 }, "") 216 return s 217 } 218 func valueToStringTimefail(v interface{}) string { 219 rv := reflect.ValueOf(v) 220 if rv.IsNil() { 221 return "nil" 222 } 223 pv := reflect.Indirect(rv).Interface() 224 return fmt.Sprintf("*%v", pv) 225 } 226 func (m *TimeFail) Unmarshal(dAtA []byte) error { 227 l := len(dAtA) 228 iNdEx := 0 229 for iNdEx < l { 230 preIndex := iNdEx 231 var wire uint64 232 for shift := uint(0); ; shift += 7 { 233 if shift >= 64 { 234 return ErrIntOverflowTimefail 235 } 236 if iNdEx >= l { 237 return io.ErrUnexpectedEOF 238 } 239 b := dAtA[iNdEx] 240 iNdEx++ 241 wire |= uint64(b&0x7F) << shift 242 if b < 0x80 { 243 break 244 } 245 } 246 fieldNum := int32(wire >> 3) 247 wireType := int(wire & 0x7) 248 if wireType == 4 { 249 return fmt.Errorf("proto: TimeFail: wiretype end group for non-group") 250 } 251 if fieldNum <= 0 { 252 return fmt.Errorf("proto: TimeFail: illegal tag %d (wire type %d)", fieldNum, wire) 253 } 254 switch fieldNum { 255 case 1: 256 if wireType != 2 { 257 return fmt.Errorf("proto: wrong wireType = %d for field TimeTest", wireType) 258 } 259 var msglen int 260 for shift := uint(0); ; shift += 7 { 261 if shift >= 64 { 262 return ErrIntOverflowTimefail 263 } 264 if iNdEx >= l { 265 return io.ErrUnexpectedEOF 266 } 267 b := dAtA[iNdEx] 268 iNdEx++ 269 msglen |= int(b&0x7F) << shift 270 if b < 0x80 { 271 break 272 } 273 } 274 if msglen < 0 { 275 return ErrInvalidLengthTimefail 276 } 277 postIndex := iNdEx + msglen 278 if postIndex < 0 { 279 return ErrInvalidLengthTimefail 280 } 281 if postIndex > l { 282 return io.ErrUnexpectedEOF 283 } 284 if m.TimeTest == nil { 285 m.TimeTest = new(time.Time) 286 } 287 if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.TimeTest, dAtA[iNdEx:postIndex]); err != nil { 288 return err 289 } 290 iNdEx = postIndex 291 default: 292 iNdEx = preIndex 293 skippy, err := skipTimefail(dAtA[iNdEx:]) 294 if err != nil { 295 return err 296 } 297 if (skippy < 0) || (iNdEx+skippy) < 0 { 298 return ErrInvalidLengthTimefail 299 } 300 if (iNdEx + skippy) > l { 301 return io.ErrUnexpectedEOF 302 } 303 iNdEx += skippy 304 } 305 } 306 307 if iNdEx > l { 308 return io.ErrUnexpectedEOF 309 } 310 return nil 311 } 312 func skipTimefail(dAtA []byte) (n int, err error) { 313 l := len(dAtA) 314 iNdEx := 0 315 depth := 0 316 for iNdEx < l { 317 var wire uint64 318 for shift := uint(0); ; shift += 7 { 319 if shift >= 64 { 320 return 0, ErrIntOverflowTimefail 321 } 322 if iNdEx >= l { 323 return 0, io.ErrUnexpectedEOF 324 } 325 b := dAtA[iNdEx] 326 iNdEx++ 327 wire |= (uint64(b) & 0x7F) << shift 328 if b < 0x80 { 329 break 330 } 331 } 332 wireType := int(wire & 0x7) 333 switch wireType { 334 case 0: 335 for shift := uint(0); ; shift += 7 { 336 if shift >= 64 { 337 return 0, ErrIntOverflowTimefail 338 } 339 if iNdEx >= l { 340 return 0, io.ErrUnexpectedEOF 341 } 342 iNdEx++ 343 if dAtA[iNdEx-1] < 0x80 { 344 break 345 } 346 } 347 case 1: 348 iNdEx += 8 349 case 2: 350 var length int 351 for shift := uint(0); ; shift += 7 { 352 if shift >= 64 { 353 return 0, ErrIntOverflowTimefail 354 } 355 if iNdEx >= l { 356 return 0, io.ErrUnexpectedEOF 357 } 358 b := dAtA[iNdEx] 359 iNdEx++ 360 length |= (int(b) & 0x7F) << shift 361 if b < 0x80 { 362 break 363 } 364 } 365 if length < 0 { 366 return 0, ErrInvalidLengthTimefail 367 } 368 iNdEx += length 369 case 3: 370 depth++ 371 case 4: 372 if depth == 0 { 373 return 0, ErrUnexpectedEndOfGroupTimefail 374 } 375 depth-- 376 case 5: 377 iNdEx += 4 378 default: 379 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 380 } 381 if iNdEx < 0 { 382 return 0, ErrInvalidLengthTimefail 383 } 384 if depth == 0 { 385 return iNdEx, nil 386 } 387 } 388 return 0, io.ErrUnexpectedEOF 389 } 390 391 var ( 392 ErrInvalidLengthTimefail = fmt.Errorf("proto: negative length found during unmarshaling") 393 ErrIntOverflowTimefail = fmt.Errorf("proto: integer overflow") 394 ErrUnexpectedEndOfGroupTimefail = fmt.Errorf("proto: unexpected end of group") 395 )