@@ -263,14 +263,16 @@ var formats = [256]*struct {
263
263
n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixStringCodeMin ), nil },
264
264
more : true ,
265
265
},
266
- negFixIntCodeMin : {
267
- t : Int ,
268
- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (int64 (int8 (code ))), nil },
269
- },
270
266
nilCode : {
271
267
t : Nil ,
272
268
n : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
273
269
},
270
+ unusedCode : {
271
+ t : Invalid ,
272
+ n : func (d * Decoder , code byte ) (uint64 , error ) {
273
+ return 0 , fmt .Errorf ("msgpack: unknown format code %x" , code )
274
+ },
275
+ },
274
276
falseCode : {
275
277
t : Bool ,
276
278
n : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
@@ -279,6 +281,36 @@ var formats = [256]*struct {
279
281
t : Bool ,
280
282
n : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
281
283
},
284
+ binary8Code : {
285
+ t : Binary ,
286
+ n : (* Decoder ).read1 ,
287
+ more : true ,
288
+ },
289
+ binary16Code : {
290
+ t : Binary ,
291
+ n : (* Decoder ).read2 ,
292
+ more : true ,
293
+ },
294
+ binary32Code : {
295
+ t : Binary ,
296
+ n : (* Decoder ).read4 ,
297
+ more : true ,
298
+ },
299
+ ext8Code : {
300
+ t : Extension ,
301
+ n : (* Decoder ).read1 ,
302
+ more : true ,
303
+ },
304
+ ext16Code : {
305
+ t : Extension ,
306
+ n : (* Decoder ).read2 ,
307
+ more : true ,
308
+ },
309
+ ext32Code : {
310
+ t : Extension ,
311
+ n : (* Decoder ).read4 ,
312
+ more : true ,
313
+ },
282
314
float32Code : {
283
315
t : Float ,
284
316
n : func (d * Decoder , code byte ) (uint64 , error ) {
@@ -331,52 +363,6 @@ var formats = [256]*struct {
331
363
t : Int ,
332
364
n : (* Decoder ).read8 ,
333
365
},
334
- string8Code : {
335
- t : String ,
336
- n : (* Decoder ).read1 ,
337
- more : true ,
338
- },
339
- string16Code : {
340
- t : String ,
341
- n : (* Decoder ).read2 ,
342
- more : true ,
343
- },
344
- string32Code : {
345
- t : String ,
346
- n : (* Decoder ).read4 ,
347
- more : true ,
348
- },
349
- binary8Code : {
350
- t : Binary ,
351
- n : (* Decoder ).read1 ,
352
- more : true ,
353
- },
354
- binary16Code : {
355
- t : Binary ,
356
- n : (* Decoder ).read2 ,
357
- more : true ,
358
- },
359
- binary32Code : {
360
- t : Binary ,
361
- n : (* Decoder ).read4 ,
362
- more : true ,
363
- },
364
- array16Code : {
365
- t : ArrayLen ,
366
- n : (* Decoder ).read2 ,
367
- },
368
- array32Code : {
369
- t : ArrayLen ,
370
- n : (* Decoder ).read4 ,
371
- },
372
- map16Code : {
373
- t : MapLen ,
374
- n : (* Decoder ).read2 ,
375
- },
376
- map32Code : {
377
- t : MapLen ,
378
- n : (* Decoder ).read4 ,
379
- },
380
366
fixExt1Code : {
381
367
t : Extension ,
382
368
n : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
@@ -402,26 +388,40 @@ var formats = [256]*struct {
402
388
n : func (d * Decoder , code byte ) (uint64 , error ) { return 16 , nil },
403
389
more : true ,
404
390
},
405
- ext8Code : {
406
- t : Extension ,
391
+ string8Code : {
392
+ t : String ,
407
393
n : (* Decoder ).read1 ,
408
394
more : true ,
409
395
},
410
- ext16Code : {
411
- t : Extension ,
396
+ string16Code : {
397
+ t : String ,
412
398
n : (* Decoder ).read2 ,
413
399
more : true ,
414
400
},
415
- ext32Code : {
416
- t : Extension ,
401
+ string32Code : {
402
+ t : String ,
417
403
n : (* Decoder ).read4 ,
418
404
more : true ,
419
405
},
420
- unusedCode : {
421
- t : Invalid ,
422
- n : func (d * Decoder , code byte ) (uint64 , error ) {
423
- return 0 , fmt .Errorf ("msgpack: unknown format code %x" , code )
424
- },
406
+ array16Code : {
407
+ t : ArrayLen ,
408
+ n : (* Decoder ).read2 ,
409
+ },
410
+ array32Code : {
411
+ t : ArrayLen ,
412
+ n : (* Decoder ).read4 ,
413
+ },
414
+ map16Code : {
415
+ t : MapLen ,
416
+ n : (* Decoder ).read2 ,
417
+ },
418
+ map32Code : {
419
+ t : MapLen ,
420
+ n : (* Decoder ).read4 ,
421
+ },
422
+ negFixIntCodeMin : {
423
+ t : Int ,
424
+ n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (int64 (int8 (code ))), nil },
425
425
},
426
426
}
427
427
0 commit comments