...

Source file src/github.com/gogo/protobuf/vanity/test/fast/proto3.pb.go

Documentation: github.com/gogo/protobuf/vanity/test/fast

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: proto3.proto
     3  
     4  package vanity
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	io "io"
    10  	math "math"
    11  	math_bits "math/bits"
    12  )
    13  
    14  // Reference imports to suppress errors if they are not otherwise used.
    15  var _ = proto.Marshal
    16  var _ = fmt.Errorf
    17  var _ = math.Inf
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the proto package it is being compiled against.
    21  // A compilation error at this line likely means your copy of the
    22  // proto package needs to be updated.
    23  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    24  
    25  type Aproto3 struct {
    26  	B                    string   `protobuf:"bytes,1,opt,name=B,proto3" json:"B,omitempty"`
    27  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    28  	XXX_unrecognized     []byte   `json:"-"`
    29  	XXX_sizecache        int32    `json:"-"`
    30  }
    31  
    32  func (m *Aproto3) Reset()         { *m = Aproto3{} }
    33  func (m *Aproto3) String() string { return proto.CompactTextString(m) }
    34  func (*Aproto3) ProtoMessage()    {}
    35  func (*Aproto3) Descriptor() ([]byte, []int) {
    36  	return fileDescriptor_4fee6d65e34a64b6, []int{0}
    37  }
    38  func (m *Aproto3) XXX_Unmarshal(b []byte) error {
    39  	return m.Unmarshal(b)
    40  }
    41  func (m *Aproto3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    42  	if deterministic {
    43  		return xxx_messageInfo_Aproto3.Marshal(b, m, deterministic)
    44  	} else {
    45  		b = b[:cap(b)]
    46  		n, err := m.MarshalToSizedBuffer(b)
    47  		if err != nil {
    48  			return nil, err
    49  		}
    50  		return b[:n], nil
    51  	}
    52  }
    53  func (m *Aproto3) XXX_Merge(src proto.Message) {
    54  	xxx_messageInfo_Aproto3.Merge(m, src)
    55  }
    56  func (m *Aproto3) XXX_Size() int {
    57  	return m.Size()
    58  }
    59  func (m *Aproto3) XXX_DiscardUnknown() {
    60  	xxx_messageInfo_Aproto3.DiscardUnknown(m)
    61  }
    62  
    63  var xxx_messageInfo_Aproto3 proto.InternalMessageInfo
    64  
    65  func (m *Aproto3) GetB() string {
    66  	if m != nil {
    67  		return m.B
    68  	}
    69  	return ""
    70  }
    71  
    72  func init() {
    73  	proto.RegisterType((*Aproto3)(nil), "vanity.Aproto3")
    74  }
    75  
    76  func init() { proto.RegisterFile("proto3.proto", fileDescriptor_4fee6d65e34a64b6) }
    77  
    78  var fileDescriptor_4fee6d65e34a64b6 = []byte{
    79  	// 82 bytes of a gzipped FileDescriptorProto
    80  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0x28, 0xca, 0x2f,
    81  	0xc9, 0x37, 0xd6, 0x03, 0x53, 0x42, 0x6c, 0x65, 0x89, 0x79, 0x99, 0x25, 0x95, 0x4a, 0xe2, 0x5c,
    82  	0xec, 0x8e, 0x10, 0x09, 0x21, 0x1e, 0x2e, 0x46, 0x27, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20,
    83  	0x46, 0x27, 0x27, 0x9e, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e,
    84  	0x31, 0x89, 0x0d, 0xa2, 0x06, 0x10, 0x00, 0x00, 0xff, 0xff, 0x97, 0x18, 0x92, 0x84, 0x45, 0x00,
    85  	0x00, 0x00,
    86  }
    87  
    88  func (m *Aproto3) Marshal() (dAtA []byte, err error) {
    89  	size := m.Size()
    90  	dAtA = make([]byte, size)
    91  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return dAtA[:n], nil
    96  }
    97  
    98  func (m *Aproto3) MarshalTo(dAtA []byte) (int, error) {
    99  	size := m.Size()
   100  	return m.MarshalToSizedBuffer(dAtA[:size])
   101  }
   102  
   103  func (m *Aproto3) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   104  	i := len(dAtA)
   105  	_ = i
   106  	var l int
   107  	_ = l
   108  	if m.XXX_unrecognized != nil {
   109  		i -= len(m.XXX_unrecognized)
   110  		copy(dAtA[i:], m.XXX_unrecognized)
   111  	}
   112  	if len(m.B) > 0 {
   113  		i -= len(m.B)
   114  		copy(dAtA[i:], m.B)
   115  		i = encodeVarintProto3(dAtA, i, uint64(len(m.B)))
   116  		i--
   117  		dAtA[i] = 0xa
   118  	}
   119  	return len(dAtA) - i, nil
   120  }
   121  
   122  func encodeVarintProto3(dAtA []byte, offset int, v uint64) int {
   123  	offset -= sovProto3(v)
   124  	base := offset
   125  	for v >= 1<<7 {
   126  		dAtA[offset] = uint8(v&0x7f | 0x80)
   127  		v >>= 7
   128  		offset++
   129  	}
   130  	dAtA[offset] = uint8(v)
   131  	return base
   132  }
   133  func (m *Aproto3) Size() (n int) {
   134  	if m == nil {
   135  		return 0
   136  	}
   137  	var l int
   138  	_ = l
   139  	l = len(m.B)
   140  	if l > 0 {
   141  		n += 1 + l + sovProto3(uint64(l))
   142  	}
   143  	if m.XXX_unrecognized != nil {
   144  		n += len(m.XXX_unrecognized)
   145  	}
   146  	return n
   147  }
   148  
   149  func sovProto3(x uint64) (n int) {
   150  	return (math_bits.Len64(x|1) + 6) / 7
   151  }
   152  func sozProto3(x uint64) (n int) {
   153  	return sovProto3(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   154  }
   155  func (m *Aproto3) Unmarshal(dAtA []byte) error {
   156  	l := len(dAtA)
   157  	iNdEx := 0
   158  	for iNdEx < l {
   159  		preIndex := iNdEx
   160  		var wire uint64
   161  		for shift := uint(0); ; shift += 7 {
   162  			if shift >= 64 {
   163  				return ErrIntOverflowProto3
   164  			}
   165  			if iNdEx >= l {
   166  				return io.ErrUnexpectedEOF
   167  			}
   168  			b := dAtA[iNdEx]
   169  			iNdEx++
   170  			wire |= uint64(b&0x7F) << shift
   171  			if b < 0x80 {
   172  				break
   173  			}
   174  		}
   175  		fieldNum := int32(wire >> 3)
   176  		wireType := int(wire & 0x7)
   177  		if wireType == 4 {
   178  			return fmt.Errorf("proto: Aproto3: wiretype end group for non-group")
   179  		}
   180  		if fieldNum <= 0 {
   181  			return fmt.Errorf("proto: Aproto3: illegal tag %d (wire type %d)", fieldNum, wire)
   182  		}
   183  		switch fieldNum {
   184  		case 1:
   185  			if wireType != 2 {
   186  				return fmt.Errorf("proto: wrong wireType = %d for field B", wireType)
   187  			}
   188  			var stringLen uint64
   189  			for shift := uint(0); ; shift += 7 {
   190  				if shift >= 64 {
   191  					return ErrIntOverflowProto3
   192  				}
   193  				if iNdEx >= l {
   194  					return io.ErrUnexpectedEOF
   195  				}
   196  				b := dAtA[iNdEx]
   197  				iNdEx++
   198  				stringLen |= uint64(b&0x7F) << shift
   199  				if b < 0x80 {
   200  					break
   201  				}
   202  			}
   203  			intStringLen := int(stringLen)
   204  			if intStringLen < 0 {
   205  				return ErrInvalidLengthProto3
   206  			}
   207  			postIndex := iNdEx + intStringLen
   208  			if postIndex < 0 {
   209  				return ErrInvalidLengthProto3
   210  			}
   211  			if postIndex > l {
   212  				return io.ErrUnexpectedEOF
   213  			}
   214  			m.B = string(dAtA[iNdEx:postIndex])
   215  			iNdEx = postIndex
   216  		default:
   217  			iNdEx = preIndex
   218  			skippy, err := skipProto3(dAtA[iNdEx:])
   219  			if err != nil {
   220  				return err
   221  			}
   222  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   223  				return ErrInvalidLengthProto3
   224  			}
   225  			if (iNdEx + skippy) > l {
   226  				return io.ErrUnexpectedEOF
   227  			}
   228  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   229  			iNdEx += skippy
   230  		}
   231  	}
   232  
   233  	if iNdEx > l {
   234  		return io.ErrUnexpectedEOF
   235  	}
   236  	return nil
   237  }
   238  func skipProto3(dAtA []byte) (n int, err error) {
   239  	l := len(dAtA)
   240  	iNdEx := 0
   241  	depth := 0
   242  	for iNdEx < l {
   243  		var wire uint64
   244  		for shift := uint(0); ; shift += 7 {
   245  			if shift >= 64 {
   246  				return 0, ErrIntOverflowProto3
   247  			}
   248  			if iNdEx >= l {
   249  				return 0, io.ErrUnexpectedEOF
   250  			}
   251  			b := dAtA[iNdEx]
   252  			iNdEx++
   253  			wire |= (uint64(b) & 0x7F) << shift
   254  			if b < 0x80 {
   255  				break
   256  			}
   257  		}
   258  		wireType := int(wire & 0x7)
   259  		switch wireType {
   260  		case 0:
   261  			for shift := uint(0); ; shift += 7 {
   262  				if shift >= 64 {
   263  					return 0, ErrIntOverflowProto3
   264  				}
   265  				if iNdEx >= l {
   266  					return 0, io.ErrUnexpectedEOF
   267  				}
   268  				iNdEx++
   269  				if dAtA[iNdEx-1] < 0x80 {
   270  					break
   271  				}
   272  			}
   273  		case 1:
   274  			iNdEx += 8
   275  		case 2:
   276  			var length int
   277  			for shift := uint(0); ; shift += 7 {
   278  				if shift >= 64 {
   279  					return 0, ErrIntOverflowProto3
   280  				}
   281  				if iNdEx >= l {
   282  					return 0, io.ErrUnexpectedEOF
   283  				}
   284  				b := dAtA[iNdEx]
   285  				iNdEx++
   286  				length |= (int(b) & 0x7F) << shift
   287  				if b < 0x80 {
   288  					break
   289  				}
   290  			}
   291  			if length < 0 {
   292  				return 0, ErrInvalidLengthProto3
   293  			}
   294  			iNdEx += length
   295  		case 3:
   296  			depth++
   297  		case 4:
   298  			if depth == 0 {
   299  				return 0, ErrUnexpectedEndOfGroupProto3
   300  			}
   301  			depth--
   302  		case 5:
   303  			iNdEx += 4
   304  		default:
   305  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   306  		}
   307  		if iNdEx < 0 {
   308  			return 0, ErrInvalidLengthProto3
   309  		}
   310  		if depth == 0 {
   311  			return iNdEx, nil
   312  		}
   313  	}
   314  	return 0, io.ErrUnexpectedEOF
   315  }
   316  
   317  var (
   318  	ErrInvalidLengthProto3        = fmt.Errorf("proto: negative length found during unmarshaling")
   319  	ErrIntOverflowProto3          = fmt.Errorf("proto: integer overflow")
   320  	ErrUnexpectedEndOfGroupProto3 = fmt.Errorf("proto: unexpected end of group")
   321  )
   322  

View as plain text