...

Source file src/github.com/gogo/protobuf/test/importcustom-issue389/imported/a.pb.go

Documentation: github.com/gogo/protobuf/test/importcustom-issue389/imported

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: a.proto
     3  
     4  package imported
     5  
     6  import (
     7  	bytes "bytes"
     8  	fmt "fmt"
     9  	_ "github.com/gogo/protobuf/gogoproto"
    10  	proto "github.com/gogo/protobuf/proto"
    11  	io "io"
    12  	math "math"
    13  	math_bits "math/bits"
    14  )
    15  
    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  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    26  
    27  type A struct {
    28  	F1                   string   `protobuf:"bytes,1,opt,name=f1,proto3" json:"f1,omitempty"`
    29  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    30  	XXX_unrecognized     []byte   `json:"-"`
    31  	XXX_sizecache        int32    `json:"-"`
    32  }
    33  
    34  func (m *A) Reset()         { *m = A{} }
    35  func (m *A) String() string { return proto.CompactTextString(m) }
    36  func (*A) ProtoMessage()    {}
    37  func (*A) Descriptor() ([]byte, []int) {
    38  	return fileDescriptor_44591ff926c61195, []int{0}
    39  }
    40  func (m *A) XXX_Unmarshal(b []byte) error {
    41  	return m.Unmarshal(b)
    42  }
    43  func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    44  	if deterministic {
    45  		return xxx_messageInfo_A.Marshal(b, m, deterministic)
    46  	} else {
    47  		b = b[:cap(b)]
    48  		n, err := m.MarshalToSizedBuffer(b)
    49  		if err != nil {
    50  			return nil, err
    51  		}
    52  		return b[:n], nil
    53  	}
    54  }
    55  func (m *A) XXX_Merge(src proto.Message) {
    56  	xxx_messageInfo_A.Merge(m, src)
    57  }
    58  func (m *A) XXX_Size() int {
    59  	return m.Size()
    60  }
    61  func (m *A) XXX_DiscardUnknown() {
    62  	xxx_messageInfo_A.DiscardUnknown(m)
    63  }
    64  
    65  var xxx_messageInfo_A proto.InternalMessageInfo
    66  
    67  func (m *A) GetF1() string {
    68  	if m != nil {
    69  		return m.F1
    70  	}
    71  	return ""
    72  }
    73  
    74  func init() {
    75  	proto.RegisterType((*A)(nil), "imported.A")
    76  }
    77  
    78  func init() { proto.RegisterFile("a.proto", fileDescriptor_44591ff926c61195) }
    79  
    80  var fileDescriptor_44591ff926c61195 = []byte{
    81  	// 127 bytes of a gzipped FileDescriptorProto
    82  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x62, 0x4f, 0xd4, 0x2b, 0x28,
    83  	0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xc8, 0xcc, 0x2d, 0xc8, 0x2f, 0x2a, 0x49, 0x4d, 0x91, 0xd2, 0x4d,
    84  	0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07,
    85  	0x2b, 0x48, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0xa2, 0x51, 0x49, 0x98, 0x8b, 0xd1,
    86  	0x51, 0x88, 0x8f, 0x8b, 0x29, 0xcd, 0x50, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x88, 0x29, 0xcd,
    87  	0xd0, 0x49, 0xe2, 0xc7, 0x43, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x77, 0x3c, 0x92, 0x63, 0x3c,
    88  	0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x93, 0xd8, 0xc0, 0xba,
    89  	0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x70, 0x12, 0x2a, 0xca, 0x79, 0x00, 0x00, 0x00,
    90  }
    91  
    92  func (this *A) Equal(that interface{}) bool {
    93  	if that == nil {
    94  		return this == nil
    95  	}
    96  
    97  	that1, ok := that.(*A)
    98  	if !ok {
    99  		that2, ok := that.(A)
   100  		if ok {
   101  			that1 = &that2
   102  		} else {
   103  			return false
   104  		}
   105  	}
   106  	if that1 == nil {
   107  		return this == nil
   108  	} else if this == nil {
   109  		return false
   110  	}
   111  	if this.F1 != that1.F1 {
   112  		return false
   113  	}
   114  	if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
   115  		return false
   116  	}
   117  	return true
   118  }
   119  func (m *A) Marshal() (dAtA []byte, err error) {
   120  	size := m.Size()
   121  	dAtA = make([]byte, size)
   122  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   123  	if err != nil {
   124  		return nil, err
   125  	}
   126  	return dAtA[:n], nil
   127  }
   128  
   129  func (m *A) MarshalTo(dAtA []byte) (int, error) {
   130  	size := m.Size()
   131  	return m.MarshalToSizedBuffer(dAtA[:size])
   132  }
   133  
   134  func (m *A) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   135  	i := len(dAtA)
   136  	_ = i
   137  	var l int
   138  	_ = l
   139  	if m.XXX_unrecognized != nil {
   140  		i -= len(m.XXX_unrecognized)
   141  		copy(dAtA[i:], m.XXX_unrecognized)
   142  	}
   143  	if len(m.F1) > 0 {
   144  		i -= len(m.F1)
   145  		copy(dAtA[i:], m.F1)
   146  		i = encodeVarintA(dAtA, i, uint64(len(m.F1)))
   147  		i--
   148  		dAtA[i] = 0xa
   149  	}
   150  	return len(dAtA) - i, nil
   151  }
   152  
   153  func encodeVarintA(dAtA []byte, offset int, v uint64) int {
   154  	offset -= sovA(v)
   155  	base := offset
   156  	for v >= 1<<7 {
   157  		dAtA[offset] = uint8(v&0x7f | 0x80)
   158  		v >>= 7
   159  		offset++
   160  	}
   161  	dAtA[offset] = uint8(v)
   162  	return base
   163  }
   164  func NewPopulatedA(r randyA, easy bool) *A {
   165  	this := &A{}
   166  	this.F1 = string(randStringA(r))
   167  	if !easy && r.Intn(10) != 0 {
   168  		this.XXX_unrecognized = randUnrecognizedA(r, 2)
   169  	}
   170  	return this
   171  }
   172  
   173  type randyA interface {
   174  	Float32() float32
   175  	Float64() float64
   176  	Int63() int64
   177  	Int31() int32
   178  	Uint32() uint32
   179  	Intn(n int) int
   180  }
   181  
   182  func randUTF8RuneA(r randyA) rune {
   183  	ru := r.Intn(62)
   184  	if ru < 10 {
   185  		return rune(ru + 48)
   186  	} else if ru < 36 {
   187  		return rune(ru + 55)
   188  	}
   189  	return rune(ru + 61)
   190  }
   191  func randStringA(r randyA) string {
   192  	v1 := r.Intn(100)
   193  	tmps := make([]rune, v1)
   194  	for i := 0; i < v1; i++ {
   195  		tmps[i] = randUTF8RuneA(r)
   196  	}
   197  	return string(tmps)
   198  }
   199  func randUnrecognizedA(r randyA, maxFieldNumber int) (dAtA []byte) {
   200  	l := r.Intn(5)
   201  	for i := 0; i < l; i++ {
   202  		wire := r.Intn(4)
   203  		if wire == 3 {
   204  			wire = 5
   205  		}
   206  		fieldNumber := maxFieldNumber + r.Intn(100)
   207  		dAtA = randFieldA(dAtA, r, fieldNumber, wire)
   208  	}
   209  	return dAtA
   210  }
   211  func randFieldA(dAtA []byte, r randyA, fieldNumber int, wire int) []byte {
   212  	key := uint32(fieldNumber)<<3 | uint32(wire)
   213  	switch wire {
   214  	case 0:
   215  		dAtA = encodeVarintPopulateA(dAtA, uint64(key))
   216  		v2 := r.Int63()
   217  		if r.Intn(2) == 0 {
   218  			v2 *= -1
   219  		}
   220  		dAtA = encodeVarintPopulateA(dAtA, uint64(v2))
   221  	case 1:
   222  		dAtA = encodeVarintPopulateA(dAtA, uint64(key))
   223  		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)))
   224  	case 2:
   225  		dAtA = encodeVarintPopulateA(dAtA, uint64(key))
   226  		ll := r.Intn(100)
   227  		dAtA = encodeVarintPopulateA(dAtA, uint64(ll))
   228  		for j := 0; j < ll; j++ {
   229  			dAtA = append(dAtA, byte(r.Intn(256)))
   230  		}
   231  	default:
   232  		dAtA = encodeVarintPopulateA(dAtA, uint64(key))
   233  		dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
   234  	}
   235  	return dAtA
   236  }
   237  func encodeVarintPopulateA(dAtA []byte, v uint64) []byte {
   238  	for v >= 1<<7 {
   239  		dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
   240  		v >>= 7
   241  	}
   242  	dAtA = append(dAtA, uint8(v))
   243  	return dAtA
   244  }
   245  func (m *A) Size() (n int) {
   246  	if m == nil {
   247  		return 0
   248  	}
   249  	var l int
   250  	_ = l
   251  	l = len(m.F1)
   252  	if l > 0 {
   253  		n += 1 + l + sovA(uint64(l))
   254  	}
   255  	if m.XXX_unrecognized != nil {
   256  		n += len(m.XXX_unrecognized)
   257  	}
   258  	return n
   259  }
   260  
   261  func sovA(x uint64) (n int) {
   262  	return (math_bits.Len64(x|1) + 6) / 7
   263  }
   264  func sozA(x uint64) (n int) {
   265  	return sovA(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   266  }
   267  func (m *A) Unmarshal(dAtA []byte) error {
   268  	l := len(dAtA)
   269  	iNdEx := 0
   270  	for iNdEx < l {
   271  		preIndex := iNdEx
   272  		var wire uint64
   273  		for shift := uint(0); ; shift += 7 {
   274  			if shift >= 64 {
   275  				return ErrIntOverflowA
   276  			}
   277  			if iNdEx >= l {
   278  				return io.ErrUnexpectedEOF
   279  			}
   280  			b := dAtA[iNdEx]
   281  			iNdEx++
   282  			wire |= uint64(b&0x7F) << shift
   283  			if b < 0x80 {
   284  				break
   285  			}
   286  		}
   287  		fieldNum := int32(wire >> 3)
   288  		wireType := int(wire & 0x7)
   289  		if wireType == 4 {
   290  			return fmt.Errorf("proto: A: wiretype end group for non-group")
   291  		}
   292  		if fieldNum <= 0 {
   293  			return fmt.Errorf("proto: A: illegal tag %d (wire type %d)", fieldNum, wire)
   294  		}
   295  		switch fieldNum {
   296  		case 1:
   297  			if wireType != 2 {
   298  				return fmt.Errorf("proto: wrong wireType = %d for field F1", wireType)
   299  			}
   300  			var stringLen uint64
   301  			for shift := uint(0); ; shift += 7 {
   302  				if shift >= 64 {
   303  					return ErrIntOverflowA
   304  				}
   305  				if iNdEx >= l {
   306  					return io.ErrUnexpectedEOF
   307  				}
   308  				b := dAtA[iNdEx]
   309  				iNdEx++
   310  				stringLen |= uint64(b&0x7F) << shift
   311  				if b < 0x80 {
   312  					break
   313  				}
   314  			}
   315  			intStringLen := int(stringLen)
   316  			if intStringLen < 0 {
   317  				return ErrInvalidLengthA
   318  			}
   319  			postIndex := iNdEx + intStringLen
   320  			if postIndex < 0 {
   321  				return ErrInvalidLengthA
   322  			}
   323  			if postIndex > l {
   324  				return io.ErrUnexpectedEOF
   325  			}
   326  			m.F1 = string(dAtA[iNdEx:postIndex])
   327  			iNdEx = postIndex
   328  		default:
   329  			iNdEx = preIndex
   330  			skippy, err := skipA(dAtA[iNdEx:])
   331  			if err != nil {
   332  				return err
   333  			}
   334  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   335  				return ErrInvalidLengthA
   336  			}
   337  			if (iNdEx + skippy) > l {
   338  				return io.ErrUnexpectedEOF
   339  			}
   340  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   341  			iNdEx += skippy
   342  		}
   343  	}
   344  
   345  	if iNdEx > l {
   346  		return io.ErrUnexpectedEOF
   347  	}
   348  	return nil
   349  }
   350  func skipA(dAtA []byte) (n int, err error) {
   351  	l := len(dAtA)
   352  	iNdEx := 0
   353  	depth := 0
   354  	for iNdEx < l {
   355  		var wire uint64
   356  		for shift := uint(0); ; shift += 7 {
   357  			if shift >= 64 {
   358  				return 0, ErrIntOverflowA
   359  			}
   360  			if iNdEx >= l {
   361  				return 0, io.ErrUnexpectedEOF
   362  			}
   363  			b := dAtA[iNdEx]
   364  			iNdEx++
   365  			wire |= (uint64(b) & 0x7F) << shift
   366  			if b < 0x80 {
   367  				break
   368  			}
   369  		}
   370  		wireType := int(wire & 0x7)
   371  		switch wireType {
   372  		case 0:
   373  			for shift := uint(0); ; shift += 7 {
   374  				if shift >= 64 {
   375  					return 0, ErrIntOverflowA
   376  				}
   377  				if iNdEx >= l {
   378  					return 0, io.ErrUnexpectedEOF
   379  				}
   380  				iNdEx++
   381  				if dAtA[iNdEx-1] < 0x80 {
   382  					break
   383  				}
   384  			}
   385  		case 1:
   386  			iNdEx += 8
   387  		case 2:
   388  			var length int
   389  			for shift := uint(0); ; shift += 7 {
   390  				if shift >= 64 {
   391  					return 0, ErrIntOverflowA
   392  				}
   393  				if iNdEx >= l {
   394  					return 0, io.ErrUnexpectedEOF
   395  				}
   396  				b := dAtA[iNdEx]
   397  				iNdEx++
   398  				length |= (int(b) & 0x7F) << shift
   399  				if b < 0x80 {
   400  					break
   401  				}
   402  			}
   403  			if length < 0 {
   404  				return 0, ErrInvalidLengthA
   405  			}
   406  			iNdEx += length
   407  		case 3:
   408  			depth++
   409  		case 4:
   410  			if depth == 0 {
   411  				return 0, ErrUnexpectedEndOfGroupA
   412  			}
   413  			depth--
   414  		case 5:
   415  			iNdEx += 4
   416  		default:
   417  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   418  		}
   419  		if iNdEx < 0 {
   420  			return 0, ErrInvalidLengthA
   421  		}
   422  		if depth == 0 {
   423  			return iNdEx, nil
   424  		}
   425  	}
   426  	return 0, io.ErrUnexpectedEOF
   427  }
   428  
   429  var (
   430  	ErrInvalidLengthA        = fmt.Errorf("proto: negative length found during unmarshaling")
   431  	ErrIntOverflowA          = fmt.Errorf("proto: integer overflow")
   432  	ErrUnexpectedEndOfGroupA = fmt.Errorf("proto: unexpected end of group")
   433  )
   434  

View as plain text