issue330.pb.go 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: issue330.proto
  3. /*
  4. Package issue330 is a generated protocol buffer package.
  5. It is generated from these files:
  6. issue330.proto
  7. It has these top-level messages:
  8. Object
  9. */
  10. package issue330
  11. import proto "github.com/gogo/protobuf/proto"
  12. import fmt "fmt"
  13. import math "math"
  14. import _ "github.com/gogo/protobuf/gogoproto"
  15. import io "io"
  16. // Reference imports to suppress errors if they are not otherwise used.
  17. var _ = proto.Marshal
  18. var _ = fmt.Errorf
  19. var _ = math.Inf
  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.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  25. type Object struct {
  26. Type TypeIdentifier `protobuf:"varint,1,opt,name=type,proto3,casttype=TypeIdentifier" json:"type,omitempty"`
  27. }
  28. func (m *Object) Reset() { *m = Object{} }
  29. func (m *Object) String() string { return proto.CompactTextString(m) }
  30. func (*Object) ProtoMessage() {}
  31. func (*Object) Descriptor() ([]byte, []int) { return fileDescriptorIssue330, []int{0} }
  32. func (m *Object) GetType() TypeIdentifier {
  33. if m != nil {
  34. return m.Type
  35. }
  36. return 0
  37. }
  38. func init() {
  39. proto.RegisterType((*Object)(nil), "issue330.Object")
  40. }
  41. func (this *Object) Equal(that interface{}) bool {
  42. if that == nil {
  43. if this == nil {
  44. return true
  45. }
  46. return false
  47. }
  48. that1, ok := that.(*Object)
  49. if !ok {
  50. that2, ok := that.(Object)
  51. if ok {
  52. that1 = &that2
  53. } else {
  54. return false
  55. }
  56. }
  57. if that1 == nil {
  58. if this == nil {
  59. return true
  60. }
  61. return false
  62. } else if this == nil {
  63. return false
  64. }
  65. if this.Type != that1.Type {
  66. return false
  67. }
  68. return true
  69. }
  70. func (m *Object) Marshal() (dAtA []byte, err error) {
  71. size := m.Size()
  72. dAtA = make([]byte, size)
  73. n, err := m.MarshalTo(dAtA)
  74. if err != nil {
  75. return nil, err
  76. }
  77. return dAtA[:n], nil
  78. }
  79. func (m *Object) MarshalTo(dAtA []byte) (int, error) {
  80. var i int
  81. _ = i
  82. var l int
  83. _ = l
  84. if m.Type != 0 {
  85. dAtA[i] = 0x8
  86. i++
  87. i = encodeVarintIssue330(dAtA, i, uint64(m.Type))
  88. }
  89. return i, nil
  90. }
  91. func encodeVarintIssue330(dAtA []byte, offset int, v uint64) int {
  92. for v >= 1<<7 {
  93. dAtA[offset] = uint8(v&0x7f | 0x80)
  94. v >>= 7
  95. offset++
  96. }
  97. dAtA[offset] = uint8(v)
  98. return offset + 1
  99. }
  100. func NewPopulatedObject(r randyIssue330, easy bool) *Object {
  101. this := &Object{}
  102. this.Type = TypeIdentifier(r.Uint32())
  103. if !easy && r.Intn(10) != 0 {
  104. }
  105. return this
  106. }
  107. type randyIssue330 interface {
  108. Float32() float32
  109. Float64() float64
  110. Int63() int64
  111. Int31() int32
  112. Uint32() uint32
  113. Intn(n int) int
  114. }
  115. func randUTF8RuneIssue330(r randyIssue330) rune {
  116. ru := r.Intn(62)
  117. if ru < 10 {
  118. return rune(ru + 48)
  119. } else if ru < 36 {
  120. return rune(ru + 55)
  121. }
  122. return rune(ru + 61)
  123. }
  124. func randStringIssue330(r randyIssue330) string {
  125. v1 := r.Intn(100)
  126. tmps := make([]rune, v1)
  127. for i := 0; i < v1; i++ {
  128. tmps[i] = randUTF8RuneIssue330(r)
  129. }
  130. return string(tmps)
  131. }
  132. func randUnrecognizedIssue330(r randyIssue330, maxFieldNumber int) (dAtA []byte) {
  133. l := r.Intn(5)
  134. for i := 0; i < l; i++ {
  135. wire := r.Intn(4)
  136. if wire == 3 {
  137. wire = 5
  138. }
  139. fieldNumber := maxFieldNumber + r.Intn(100)
  140. dAtA = randFieldIssue330(dAtA, r, fieldNumber, wire)
  141. }
  142. return dAtA
  143. }
  144. func randFieldIssue330(dAtA []byte, r randyIssue330, fieldNumber int, wire int) []byte {
  145. key := uint32(fieldNumber)<<3 | uint32(wire)
  146. switch wire {
  147. case 0:
  148. dAtA = encodeVarintPopulateIssue330(dAtA, uint64(key))
  149. v2 := r.Int63()
  150. if r.Intn(2) == 0 {
  151. v2 *= -1
  152. }
  153. dAtA = encodeVarintPopulateIssue330(dAtA, uint64(v2))
  154. case 1:
  155. dAtA = encodeVarintPopulateIssue330(dAtA, uint64(key))
  156. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  157. case 2:
  158. dAtA = encodeVarintPopulateIssue330(dAtA, uint64(key))
  159. ll := r.Intn(100)
  160. dAtA = encodeVarintPopulateIssue330(dAtA, uint64(ll))
  161. for j := 0; j < ll; j++ {
  162. dAtA = append(dAtA, byte(r.Intn(256)))
  163. }
  164. default:
  165. dAtA = encodeVarintPopulateIssue330(dAtA, uint64(key))
  166. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  167. }
  168. return dAtA
  169. }
  170. func encodeVarintPopulateIssue330(dAtA []byte, v uint64) []byte {
  171. for v >= 1<<7 {
  172. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  173. v >>= 7
  174. }
  175. dAtA = append(dAtA, uint8(v))
  176. return dAtA
  177. }
  178. func (m *Object) Size() (n int) {
  179. var l int
  180. _ = l
  181. if m.Type != 0 {
  182. n += 1 + sovIssue330(uint64(m.Type))
  183. }
  184. return n
  185. }
  186. func sovIssue330(x uint64) (n int) {
  187. for {
  188. n++
  189. x >>= 7
  190. if x == 0 {
  191. break
  192. }
  193. }
  194. return n
  195. }
  196. func sozIssue330(x uint64) (n int) {
  197. return sovIssue330(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  198. }
  199. func (m *Object) Unmarshal(dAtA []byte) error {
  200. l := len(dAtA)
  201. iNdEx := 0
  202. for iNdEx < l {
  203. preIndex := iNdEx
  204. var wire uint64
  205. for shift := uint(0); ; shift += 7 {
  206. if shift >= 64 {
  207. return ErrIntOverflowIssue330
  208. }
  209. if iNdEx >= l {
  210. return io.ErrUnexpectedEOF
  211. }
  212. b := dAtA[iNdEx]
  213. iNdEx++
  214. wire |= (uint64(b) & 0x7F) << shift
  215. if b < 0x80 {
  216. break
  217. }
  218. }
  219. fieldNum := int32(wire >> 3)
  220. wireType := int(wire & 0x7)
  221. if wireType == 4 {
  222. return fmt.Errorf("proto: Object: wiretype end group for non-group")
  223. }
  224. if fieldNum <= 0 {
  225. return fmt.Errorf("proto: Object: illegal tag %d (wire type %d)", fieldNum, wire)
  226. }
  227. switch fieldNum {
  228. case 1:
  229. if wireType != 0 {
  230. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  231. }
  232. m.Type = 0
  233. for shift := uint(0); ; shift += 7 {
  234. if shift >= 64 {
  235. return ErrIntOverflowIssue330
  236. }
  237. if iNdEx >= l {
  238. return io.ErrUnexpectedEOF
  239. }
  240. b := dAtA[iNdEx]
  241. iNdEx++
  242. m.Type |= (TypeIdentifier(b) & 0x7F) << shift
  243. if b < 0x80 {
  244. break
  245. }
  246. }
  247. default:
  248. iNdEx = preIndex
  249. skippy, err := skipIssue330(dAtA[iNdEx:])
  250. if err != nil {
  251. return err
  252. }
  253. if skippy < 0 {
  254. return ErrInvalidLengthIssue330
  255. }
  256. if (iNdEx + skippy) > l {
  257. return io.ErrUnexpectedEOF
  258. }
  259. iNdEx += skippy
  260. }
  261. }
  262. if iNdEx > l {
  263. return io.ErrUnexpectedEOF
  264. }
  265. return nil
  266. }
  267. func skipIssue330(dAtA []byte) (n int, err error) {
  268. l := len(dAtA)
  269. iNdEx := 0
  270. for iNdEx < l {
  271. var wire uint64
  272. for shift := uint(0); ; shift += 7 {
  273. if shift >= 64 {
  274. return 0, ErrIntOverflowIssue330
  275. }
  276. if iNdEx >= l {
  277. return 0, io.ErrUnexpectedEOF
  278. }
  279. b := dAtA[iNdEx]
  280. iNdEx++
  281. wire |= (uint64(b) & 0x7F) << shift
  282. if b < 0x80 {
  283. break
  284. }
  285. }
  286. wireType := int(wire & 0x7)
  287. switch wireType {
  288. case 0:
  289. for shift := uint(0); ; shift += 7 {
  290. if shift >= 64 {
  291. return 0, ErrIntOverflowIssue330
  292. }
  293. if iNdEx >= l {
  294. return 0, io.ErrUnexpectedEOF
  295. }
  296. iNdEx++
  297. if dAtA[iNdEx-1] < 0x80 {
  298. break
  299. }
  300. }
  301. return iNdEx, nil
  302. case 1:
  303. iNdEx += 8
  304. return iNdEx, nil
  305. case 2:
  306. var length int
  307. for shift := uint(0); ; shift += 7 {
  308. if shift >= 64 {
  309. return 0, ErrIntOverflowIssue330
  310. }
  311. if iNdEx >= l {
  312. return 0, io.ErrUnexpectedEOF
  313. }
  314. b := dAtA[iNdEx]
  315. iNdEx++
  316. length |= (int(b) & 0x7F) << shift
  317. if b < 0x80 {
  318. break
  319. }
  320. }
  321. iNdEx += length
  322. if length < 0 {
  323. return 0, ErrInvalidLengthIssue330
  324. }
  325. return iNdEx, nil
  326. case 3:
  327. for {
  328. var innerWire uint64
  329. var start int = iNdEx
  330. for shift := uint(0); ; shift += 7 {
  331. if shift >= 64 {
  332. return 0, ErrIntOverflowIssue330
  333. }
  334. if iNdEx >= l {
  335. return 0, io.ErrUnexpectedEOF
  336. }
  337. b := dAtA[iNdEx]
  338. iNdEx++
  339. innerWire |= (uint64(b) & 0x7F) << shift
  340. if b < 0x80 {
  341. break
  342. }
  343. }
  344. innerWireType := int(innerWire & 0x7)
  345. if innerWireType == 4 {
  346. break
  347. }
  348. next, err := skipIssue330(dAtA[start:])
  349. if err != nil {
  350. return 0, err
  351. }
  352. iNdEx = start + next
  353. }
  354. return iNdEx, nil
  355. case 4:
  356. return iNdEx, nil
  357. case 5:
  358. iNdEx += 4
  359. return iNdEx, nil
  360. default:
  361. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  362. }
  363. }
  364. panic("unreachable")
  365. }
  366. var (
  367. ErrInvalidLengthIssue330 = fmt.Errorf("proto: negative length found during unmarshaling")
  368. ErrIntOverflowIssue330 = fmt.Errorf("proto: integer overflow")
  369. )
  370. func init() { proto.RegisterFile("issue330.proto", fileDescriptorIssue330) }
  371. var fileDescriptorIssue330 = []byte{
  372. // 158 bytes of a gzipped FileDescriptorProto
  373. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x2c, 0x2e, 0x2e,
  374. 0x4d, 0x35, 0x36, 0x36, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74,
  375. 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5,
  376. 0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x54, 0x32, 0xe0, 0x62,
  377. 0xf3, 0x4f, 0xca, 0x4a, 0x4d, 0x2e, 0x11, 0x52, 0xe3, 0x62, 0x29, 0xa9, 0x2c, 0x48, 0x95, 0x60,
  378. 0x54, 0x60, 0xd4, 0xe0, 0x75, 0x12, 0xfa, 0x75, 0x4f, 0x9e, 0x2f, 0xa4, 0xb2, 0x20, 0xd5, 0x33,
  379. 0x25, 0x35, 0xaf, 0x24, 0x33, 0x2d, 0x33, 0xb5, 0x28, 0x08, 0x2c, 0xef, 0x24, 0xf3, 0xe3, 0xa1,
  380. 0x1c, 0xe3, 0x8a, 0x47, 0x72, 0x8c, 0x3b, 0x1e, 0xc9, 0x31, 0x1e, 0x78, 0x24, 0xc7, 0x78, 0xe2,
  381. 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x26, 0xb1, 0x81, 0x8d, 0x35,
  382. 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x41, 0xc2, 0x37, 0xa1, 0x00, 0x00, 0x00,
  383. }