github.com/gogo/protobuf@v1.3.2/test/typedeclimport/subpkg/subpkg.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: subpkg/subpkg.proto
     3  
     4  /*
     5  Package subpkg is a generated protocol buffer package.
     6  
     7  It is generated from these files:
     8  	subpkg/subpkg.proto
     9  
    10  It has these top-level messages:
    11  	AnotherMessage
    12  */
    13  package subpkg
    14  
    15  import proto "github.com/gogo/protobuf/proto"
    16  import fmt "fmt"
    17  import math "math"
    18  import _ "github.com/gogo/protobuf/gogoproto"
    19  
    20  import io "io"
    21  
    22  // Reference imports to suppress errors if they are not otherwise used.
    23  var _ = proto.Marshal
    24  var _ = fmt.Errorf
    25  var _ = math.Inf
    26  
    27  // This is a compile-time assertion to ensure that this generated file
    28  // is compatible with the proto package it is being compiled against.
    29  // A compilation error at this line likely means your copy of the
    30  // proto package needs to be updated.
    31  const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
    32  
    33  type AnotherMessage struct {
    34  	Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
    35  }
    36  
    37  func (m *AnotherMessage) Reset()                    { *m = AnotherMessage{} }
    38  func (m *AnotherMessage) String() string            { return proto.CompactTextString(m) }
    39  func (*AnotherMessage) ProtoMessage()               {}
    40  func (*AnotherMessage) Descriptor() ([]byte, []int) { return fileDescriptorSubpkg, []int{0} }
    41  
    42  func (m *AnotherMessage) GetFoo() string {
    43  	if m != nil {
    44  		return m.Foo
    45  	}
    46  	return ""
    47  }
    48  
    49  func init() {
    50  	proto.RegisterType((*AnotherMessage)(nil), "subpkg.AnotherMessage")
    51  }
    52  func (this *AnotherMessage) VerboseEqual(that interface{}) error {
    53  	if that == nil {
    54  		if this == nil {
    55  			return nil
    56  		}
    57  		return fmt.Errorf("that == nil && this != nil")
    58  	}
    59  
    60  	that1, ok := that.(*AnotherMessage)
    61  	if !ok {
    62  		that2, ok := that.(AnotherMessage)
    63  		if ok {
    64  			that1 = &that2
    65  		} else {
    66  			return fmt.Errorf("that is not of type *AnotherMessage")
    67  		}
    68  	}
    69  	if that1 == nil {
    70  		if this == nil {
    71  			return nil
    72  		}
    73  		return fmt.Errorf("that is type *AnotherMessage but is nil && this != nil")
    74  	} else if this == nil {
    75  		return fmt.Errorf("that is type *AnotherMessage but is not nil && this == nil")
    76  	}
    77  	if this.Foo != that1.Foo {
    78  		return fmt.Errorf("Foo this(%v) Not Equal that(%v)", this.Foo, that1.Foo)
    79  	}
    80  	return nil
    81  }
    82  func (this *AnotherMessage) Equal(that interface{}) bool {
    83  	if that == nil {
    84  		if this == nil {
    85  			return true
    86  		}
    87  		return false
    88  	}
    89  
    90  	that1, ok := that.(*AnotherMessage)
    91  	if !ok {
    92  		that2, ok := that.(AnotherMessage)
    93  		if ok {
    94  			that1 = &that2
    95  		} else {
    96  			return false
    97  		}
    98  	}
    99  	if that1 == nil {
   100  		if this == nil {
   101  			return true
   102  		}
   103  		return false
   104  	} else if this == nil {
   105  		return false
   106  	}
   107  	if this.Foo != that1.Foo {
   108  		return false
   109  	}
   110  	return true
   111  }
   112  func (m *AnotherMessage) Marshal() (dAtA []byte, err error) {
   113  	size := m.Size()
   114  	dAtA = make([]byte, size)
   115  	n, err := m.MarshalTo(dAtA)
   116  	if err != nil {
   117  		return nil, err
   118  	}
   119  	return dAtA[:n], nil
   120  }
   121  
   122  func (m *AnotherMessage) MarshalTo(dAtA []byte) (int, error) {
   123  	var i int
   124  	_ = i
   125  	var l int
   126  	_ = l
   127  	if len(m.Foo) > 0 {
   128  		dAtA[i] = 0xa
   129  		i++
   130  		i = encodeVarintSubpkg(dAtA, i, uint64(len(m.Foo)))
   131  		i += copy(dAtA[i:], m.Foo)
   132  	}
   133  	return i, nil
   134  }
   135  
   136  func encodeFixed64Subpkg(dAtA []byte, offset int, v uint64) int {
   137  	dAtA[offset] = uint8(v)
   138  	dAtA[offset+1] = uint8(v >> 8)
   139  	dAtA[offset+2] = uint8(v >> 16)
   140  	dAtA[offset+3] = uint8(v >> 24)
   141  	dAtA[offset+4] = uint8(v >> 32)
   142  	dAtA[offset+5] = uint8(v >> 40)
   143  	dAtA[offset+6] = uint8(v >> 48)
   144  	dAtA[offset+7] = uint8(v >> 56)
   145  	return offset + 8
   146  }
   147  func encodeFixed32Subpkg(dAtA []byte, offset int, v uint32) int {
   148  	dAtA[offset] = uint8(v)
   149  	dAtA[offset+1] = uint8(v >> 8)
   150  	dAtA[offset+2] = uint8(v >> 16)
   151  	dAtA[offset+3] = uint8(v >> 24)
   152  	return offset + 4
   153  }
   154  func encodeVarintSubpkg(dAtA []byte, offset int, v uint64) int {
   155  	for v >= 1<<7 {
   156  		dAtA[offset] = uint8(v&0x7f | 0x80)
   157  		v >>= 7
   158  		offset++
   159  	}
   160  	dAtA[offset] = uint8(v)
   161  	return offset + 1
   162  }
   163  func (m *AnotherMessage) Size() (n int) {
   164  	var l int
   165  	_ = l
   166  	l = len(m.Foo)
   167  	if l > 0 {
   168  		n += 1 + l + sovSubpkg(uint64(l))
   169  	}
   170  	return n
   171  }
   172  
   173  func sovSubpkg(x uint64) (n int) {
   174  	for {
   175  		n++
   176  		x >>= 7
   177  		if x == 0 {
   178  			break
   179  		}
   180  	}
   181  	return n
   182  }
   183  func sozSubpkg(x uint64) (n int) {
   184  	return sovSubpkg(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   185  }
   186  func (m *AnotherMessage) Unmarshal(dAtA []byte) error {
   187  	l := len(dAtA)
   188  	iNdEx := 0
   189  	for iNdEx < l {
   190  		preIndex := iNdEx
   191  		var wire uint64
   192  		for shift := uint(0); ; shift += 7 {
   193  			if shift >= 64 {
   194  				return ErrIntOverflowSubpkg
   195  			}
   196  			if iNdEx >= l {
   197  				return io.ErrUnexpectedEOF
   198  			}
   199  			b := dAtA[iNdEx]
   200  			iNdEx++
   201  			wire |= (uint64(b) & 0x7F) << shift
   202  			if b < 0x80 {
   203  				break
   204  			}
   205  		}
   206  		fieldNum := int32(wire >> 3)
   207  		wireType := int(wire & 0x7)
   208  		if wireType == 4 {
   209  			return fmt.Errorf("proto: AnotherMessage: wiretype end group for non-group")
   210  		}
   211  		if fieldNum <= 0 {
   212  			return fmt.Errorf("proto: AnotherMessage: illegal tag %d (wire type %d)", fieldNum, wire)
   213  		}
   214  		switch fieldNum {
   215  		case 1:
   216  			if wireType != 2 {
   217  				return fmt.Errorf("proto: wrong wireType = %d for field Foo", wireType)
   218  			}
   219  			var stringLen uint64
   220  			for shift := uint(0); ; shift += 7 {
   221  				if shift >= 64 {
   222  					return ErrIntOverflowSubpkg
   223  				}
   224  				if iNdEx >= l {
   225  					return io.ErrUnexpectedEOF
   226  				}
   227  				b := dAtA[iNdEx]
   228  				iNdEx++
   229  				stringLen |= (uint64(b) & 0x7F) << shift
   230  				if b < 0x80 {
   231  					break
   232  				}
   233  			}
   234  			intStringLen := int(stringLen)
   235  			if intStringLen < 0 {
   236  				return ErrInvalidLengthSubpkg
   237  			}
   238  			postIndex := iNdEx + intStringLen
   239  			if postIndex > l {
   240  				return io.ErrUnexpectedEOF
   241  			}
   242  			m.Foo = string(dAtA[iNdEx:postIndex])
   243  			iNdEx = postIndex
   244  		default:
   245  			iNdEx = preIndex
   246  			skippy, err := skipSubpkg(dAtA[iNdEx:])
   247  			if err != nil {
   248  				return err
   249  			}
   250  			if skippy < 0 {
   251  				return ErrInvalidLengthSubpkg
   252  			}
   253  			if (iNdEx + skippy) > l {
   254  				return io.ErrUnexpectedEOF
   255  			}
   256  			iNdEx += skippy
   257  		}
   258  	}
   259  
   260  	if iNdEx > l {
   261  		return io.ErrUnexpectedEOF
   262  	}
   263  	return nil
   264  }
   265  func skipSubpkg(dAtA []byte) (n int, err error) {
   266  	l := len(dAtA)
   267  	iNdEx := 0
   268  	for iNdEx < l {
   269  		var wire uint64
   270  		for shift := uint(0); ; shift += 7 {
   271  			if shift >= 64 {
   272  				return 0, ErrIntOverflowSubpkg
   273  			}
   274  			if iNdEx >= l {
   275  				return 0, io.ErrUnexpectedEOF
   276  			}
   277  			b := dAtA[iNdEx]
   278  			iNdEx++
   279  			wire |= (uint64(b) & 0x7F) << shift
   280  			if b < 0x80 {
   281  				break
   282  			}
   283  		}
   284  		wireType := int(wire & 0x7)
   285  		switch wireType {
   286  		case 0:
   287  			for shift := uint(0); ; shift += 7 {
   288  				if shift >= 64 {
   289  					return 0, ErrIntOverflowSubpkg
   290  				}
   291  				if iNdEx >= l {
   292  					return 0, io.ErrUnexpectedEOF
   293  				}
   294  				iNdEx++
   295  				if dAtA[iNdEx-1] < 0x80 {
   296  					break
   297  				}
   298  			}
   299  			return iNdEx, nil
   300  		case 1:
   301  			iNdEx += 8
   302  			return iNdEx, nil
   303  		case 2:
   304  			var length int
   305  			for shift := uint(0); ; shift += 7 {
   306  				if shift >= 64 {
   307  					return 0, ErrIntOverflowSubpkg
   308  				}
   309  				if iNdEx >= l {
   310  					return 0, io.ErrUnexpectedEOF
   311  				}
   312  				b := dAtA[iNdEx]
   313  				iNdEx++
   314  				length |= (int(b) & 0x7F) << shift
   315  				if b < 0x80 {
   316  					break
   317  				}
   318  			}
   319  			iNdEx += length
   320  			if length < 0 {
   321  				return 0, ErrInvalidLengthSubpkg
   322  			}
   323  			return iNdEx, nil
   324  		case 3:
   325  			for {
   326  				var innerWire uint64
   327  				var start int = iNdEx
   328  				for shift := uint(0); ; shift += 7 {
   329  					if shift >= 64 {
   330  						return 0, ErrIntOverflowSubpkg
   331  					}
   332  					if iNdEx >= l {
   333  						return 0, io.ErrUnexpectedEOF
   334  					}
   335  					b := dAtA[iNdEx]
   336  					iNdEx++
   337  					innerWire |= (uint64(b) & 0x7F) << shift
   338  					if b < 0x80 {
   339  						break
   340  					}
   341  				}
   342  				innerWireType := int(innerWire & 0x7)
   343  				if innerWireType == 4 {
   344  					break
   345  				}
   346  				next, err := skipSubpkg(dAtA[start:])
   347  				if err != nil {
   348  					return 0, err
   349  				}
   350  				iNdEx = start + next
   351  			}
   352  			return iNdEx, nil
   353  		case 4:
   354  			return iNdEx, nil
   355  		case 5:
   356  			iNdEx += 4
   357  			return iNdEx, nil
   358  		default:
   359  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   360  		}
   361  	}
   362  	panic("unreachable")
   363  }
   364  
   365  var (
   366  	ErrInvalidLengthSubpkg = fmt.Errorf("proto: negative length found during unmarshaling")
   367  	ErrIntOverflowSubpkg   = fmt.Errorf("proto: integer overflow")
   368  )
   369  
   370  func init() { proto.RegisterFile("subpkg/subpkg.proto", fileDescriptorSubpkg) }
   371  
   372  var fileDescriptorSubpkg = []byte{
   373  	// 137 bytes of a gzipped FileDescriptorProto
   374  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x2e, 0x4d, 0x2a,
   375  	0xc8, 0x4e, 0xd7, 0x87, 0x50, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x6c, 0x10, 0x9e, 0x94,
   376  	0x6e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x7e, 0x7a, 0x7e, 0x7a, 0xbe,
   377  	0x3e, 0x58, 0x3a, 0xa9, 0x34, 0x0d, 0xcc, 0x03, 0x73, 0xc0, 0x2c, 0x88, 0x36, 0x25, 0x25, 0x2e,
   378  	0x3e, 0xc7, 0xbc, 0xfc, 0x92, 0x8c, 0xd4, 0x22, 0xdf, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x21,
   379  	0x01, 0x2e, 0xe6, 0xb4, 0xfc, 0x7c, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0xd3, 0x49,
   380  	0xe4, 0xc1, 0x43, 0x39, 0xc6, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48,
   381  	0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x24, 0x36, 0xb0, 0x01, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff,
   382  	0xff, 0x37, 0x5d, 0xf6, 0x73, 0x8e, 0x00, 0x00, 0x00,
   383  }