1
2
3
4 package importduplicate
5
6 import (
7 bytes "bytes"
8 fmt "fmt"
9 _ "github.com/gogo/protobuf/gogoproto"
10 proto "github.com/gogo/protobuf/proto"
11 github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys"
12 proto1 "github.com/gogo/protobuf/test/importduplicate/proto"
13 sortkeys "github.com/gogo/protobuf/test/importduplicate/sortkeys"
14 math "math"
15 reflect "reflect"
16 strings "strings"
17 )
18
19
20 var _ = proto.Marshal
21 var _ = fmt.Errorf
22 var _ = math.Inf
23
24
25
26
27
28 const _ = proto.GoGoProtoPackageIsVersion3
29
30 type MapAndSortKeys struct {
31 Key *sortkeys.Object `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
32 KeyValue map[int32]string `protobuf:"bytes,2,rep,name=keyValue,proto3" json:"keyValue,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
33 Value *proto1.Subject `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
34 XXX_NoUnkeyedLiteral struct{} `json:"-"`
35 XXX_unrecognized []byte `json:"-"`
36 XXX_sizecache int32 `json:"-"`
37 }
38
39 func (m *MapAndSortKeys) Reset() { *m = MapAndSortKeys{} }
40 func (m *MapAndSortKeys) String() string { return proto.CompactTextString(m) }
41 func (*MapAndSortKeys) ProtoMessage() {}
42 func (*MapAndSortKeys) Descriptor() ([]byte, []int) {
43 return fileDescriptor_f3b420b76fd5209f, []int{0}
44 }
45 func (m *MapAndSortKeys) XXX_Unmarshal(b []byte) error {
46 return xxx_messageInfo_MapAndSortKeys.Unmarshal(m, b)
47 }
48 func (m *MapAndSortKeys) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
49 return xxx_messageInfo_MapAndSortKeys.Marshal(b, m, deterministic)
50 }
51 func (m *MapAndSortKeys) XXX_Merge(src proto.Message) {
52 xxx_messageInfo_MapAndSortKeys.Merge(m, src)
53 }
54 func (m *MapAndSortKeys) XXX_Size() int {
55 return xxx_messageInfo_MapAndSortKeys.Size(m)
56 }
57 func (m *MapAndSortKeys) XXX_DiscardUnknown() {
58 xxx_messageInfo_MapAndSortKeys.DiscardUnknown(m)
59 }
60
61 var xxx_messageInfo_MapAndSortKeys proto.InternalMessageInfo
62
63 func (m *MapAndSortKeys) GetKey() *sortkeys.Object {
64 if m != nil {
65 return m.Key
66 }
67 return nil
68 }
69
70 func (m *MapAndSortKeys) GetKeyValue() map[int32]string {
71 if m != nil {
72 return m.KeyValue
73 }
74 return nil
75 }
76
77 func (m *MapAndSortKeys) GetValue() *proto1.Subject {
78 if m != nil {
79 return m.Value
80 }
81 return nil
82 }
83
84 func init() {
85 proto.RegisterType((*MapAndSortKeys)(nil), "importduplicate.MapAndSortKeys")
86 proto.RegisterMapType((map[int32]string)(nil), "importduplicate.MapAndSortKeys.KeyValueEntry")
87 }
88
89 func init() { proto.RegisterFile("importduplicate.proto", fileDescriptor_f3b420b76fd5209f) }
90
91 var fileDescriptor_f3b420b76fd5209f = []byte{
92
93 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcd, 0xcc, 0x2d, 0xc8,
94 0x2f, 0x2a, 0x49, 0x29, 0x2d, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f,
95 0xc9, 0x17, 0xe2, 0x47, 0x13, 0x96, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce,
96 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0xab, 0x4b, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c,
97 0x30, 0x0b, 0xa2, 0x5f, 0xca, 0x15, 0xa7, 0xf2, 0x92, 0xd4, 0xe2, 0x12, 0x7d, 0x34, 0xd3, 0xf5,
98 0x8b, 0xf3, 0x8b, 0x4a, 0xb2, 0x53, 0x2b, 0x8b, 0xc1, 0x8c, 0xc4, 0xa4, 0x1c, 0xa8, 0x33, 0xa4,
99 0xec, 0x49, 0x33, 0x06, 0xe2, 0x0c, 0x30, 0x09, 0x31, 0x40, 0xe9, 0x11, 0x23, 0x17, 0x9f, 0x6f,
100 0x62, 0x81, 0x63, 0x5e, 0x4a, 0x70, 0x7e, 0x51, 0x89, 0x77, 0x6a, 0x65, 0xb1, 0x90, 0x12, 0x17,
101 0x73, 0x76, 0x6a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x80, 0x1e, 0xcc, 0x6a, 0x3d,
102 0xff, 0xa4, 0xac, 0xd4, 0xe4, 0x92, 0x20, 0x90, 0xa4, 0x90, 0x27, 0x17, 0x47, 0x76, 0x6a, 0x65,
103 0x58, 0x62, 0x4e, 0x69, 0xaa, 0x04, 0x93, 0x02, 0xb3, 0x06, 0xb7, 0x91, 0xae, 0x1e, 0x7a, 0x40,
104 0xa1, 0x1a, 0xab, 0xe7, 0x0d, 0x55, 0xef, 0x9a, 0x57, 0x52, 0x54, 0x19, 0x04, 0xd7, 0x2e, 0xa4,
105 0xc2, 0xc5, 0x5a, 0x06, 0x36, 0x87, 0x19, 0x6c, 0x21, 0x1f, 0xc4, 0x61, 0x7a, 0xc1, 0xa5, 0x10,
106 0xeb, 0x20, 0x92, 0x52, 0xd6, 0x5c, 0xbc, 0x28, 0x06, 0x08, 0x09, 0x20, 0x5c, 0xc9, 0x0a, 0x71,
107 0x93, 0x08, 0xcc, 0x20, 0x26, 0x05, 0x46, 0x0d, 0x4e, 0xa8, 0x46, 0x2b, 0x26, 0x0b, 0x46, 0x27,
108 0x81, 0x0f, 0x0f, 0xe5, 0x18, 0x7f, 0x3c, 0x94, 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0x71, 0xc7, 0x23,
109 0x39, 0xc6, 0x24, 0x36, 0xb0, 0x25, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x50, 0xcc, 0xec,
110 0x38, 0xde, 0x01, 0x00, 0x00,
111 }
112
113 func (this *MapAndSortKeys) Equal(that interface{}) bool {
114 if that == nil {
115 return this == nil
116 }
117
118 that1, ok := that.(*MapAndSortKeys)
119 if !ok {
120 that2, ok := that.(MapAndSortKeys)
121 if ok {
122 that1 = &that2
123 } else {
124 return false
125 }
126 }
127 if that1 == nil {
128 return this == nil
129 } else if this == nil {
130 return false
131 }
132 if !this.Key.Equal(that1.Key) {
133 return false
134 }
135 if len(this.KeyValue) != len(that1.KeyValue) {
136 return false
137 }
138 for i := range this.KeyValue {
139 if this.KeyValue[i] != that1.KeyValue[i] {
140 return false
141 }
142 }
143 if !this.Value.Equal(that1.Value) {
144 return false
145 }
146 if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
147 return false
148 }
149 return true
150 }
151 func (this *MapAndSortKeys) GoString() string {
152 if this == nil {
153 return "nil"
154 }
155 s := make([]string, 0, 7)
156 s = append(s, "&importduplicate.MapAndSortKeys{")
157 if this.Key != nil {
158 s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n")
159 }
160 keysForKeyValue := make([]int32, 0, len(this.KeyValue))
161 for k := range this.KeyValue {
162 keysForKeyValue = append(keysForKeyValue, k)
163 }
164 github_com_gogo_protobuf_sortkeys.Int32s(keysForKeyValue)
165 mapStringForKeyValue := "map[int32]string{"
166 for _, k := range keysForKeyValue {
167 mapStringForKeyValue += fmt.Sprintf("%#v: %#v,", k, this.KeyValue[k])
168 }
169 mapStringForKeyValue += "}"
170 if this.KeyValue != nil {
171 s = append(s, "KeyValue: "+mapStringForKeyValue+",\n")
172 }
173 if this.Value != nil {
174 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n")
175 }
176 if this.XXX_unrecognized != nil {
177 s = append(s, "XXX_unrecognized:"+fmt.Sprintf("%#v", this.XXX_unrecognized)+",\n")
178 }
179 s = append(s, "}")
180 return strings.Join(s, "")
181 }
182 func valueToGoStringImportduplicate(v interface{}, typ string) string {
183 rv := reflect.ValueOf(v)
184 if rv.IsNil() {
185 return "nil"
186 }
187 pv := reflect.Indirect(rv).Interface()
188 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv)
189 }
190 func NewPopulatedMapAndSortKeys(r randyImportduplicate, easy bool) *MapAndSortKeys {
191 this := &MapAndSortKeys{}
192 if r.Intn(5) != 0 {
193 this.Key = sortkeys.NewPopulatedObject(r, easy)
194 }
195 if r.Intn(5) != 0 {
196 v1 := r.Intn(10)
197 this.KeyValue = make(map[int32]string)
198 for i := 0; i < v1; i++ {
199 this.KeyValue[int32(r.Int31())] = randStringImportduplicate(r)
200 }
201 }
202 if r.Intn(5) != 0 {
203 this.Value = proto1.NewPopulatedSubject(r, easy)
204 }
205 if !easy && r.Intn(10) != 0 {
206 this.XXX_unrecognized = randUnrecognizedImportduplicate(r, 4)
207 }
208 return this
209 }
210
211 type randyImportduplicate interface {
212 Float32() float32
213 Float64() float64
214 Int63() int64
215 Int31() int32
216 Uint32() uint32
217 Intn(n int) int
218 }
219
220 func randUTF8RuneImportduplicate(r randyImportduplicate) rune {
221 ru := r.Intn(62)
222 if ru < 10 {
223 return rune(ru + 48)
224 } else if ru < 36 {
225 return rune(ru + 55)
226 }
227 return rune(ru + 61)
228 }
229 func randStringImportduplicate(r randyImportduplicate) string {
230 v2 := r.Intn(100)
231 tmps := make([]rune, v2)
232 for i := 0; i < v2; i++ {
233 tmps[i] = randUTF8RuneImportduplicate(r)
234 }
235 return string(tmps)
236 }
237 func randUnrecognizedImportduplicate(r randyImportduplicate, maxFieldNumber int) (dAtA []byte) {
238 l := r.Intn(5)
239 for i := 0; i < l; i++ {
240 wire := r.Intn(4)
241 if wire == 3 {
242 wire = 5
243 }
244 fieldNumber := maxFieldNumber + r.Intn(100)
245 dAtA = randFieldImportduplicate(dAtA, r, fieldNumber, wire)
246 }
247 return dAtA
248 }
249 func randFieldImportduplicate(dAtA []byte, r randyImportduplicate, fieldNumber int, wire int) []byte {
250 key := uint32(fieldNumber)<<3 | uint32(wire)
251 switch wire {
252 case 0:
253 dAtA = encodeVarintPopulateImportduplicate(dAtA, uint64(key))
254 v3 := r.Int63()
255 if r.Intn(2) == 0 {
256 v3 *= -1
257 }
258 dAtA = encodeVarintPopulateImportduplicate(dAtA, uint64(v3))
259 case 1:
260 dAtA = encodeVarintPopulateImportduplicate(dAtA, uint64(key))
261 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)))
262 case 2:
263 dAtA = encodeVarintPopulateImportduplicate(dAtA, uint64(key))
264 ll := r.Intn(100)
265 dAtA = encodeVarintPopulateImportduplicate(dAtA, uint64(ll))
266 for j := 0; j < ll; j++ {
267 dAtA = append(dAtA, byte(r.Intn(256)))
268 }
269 default:
270 dAtA = encodeVarintPopulateImportduplicate(dAtA, uint64(key))
271 dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
272 }
273 return dAtA
274 }
275 func encodeVarintPopulateImportduplicate(dAtA []byte, v uint64) []byte {
276 for v >= 1<<7 {
277 dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
278 v >>= 7
279 }
280 dAtA = append(dAtA, uint8(v))
281 return dAtA
282 }
283
View as plain text