@@ -263,14 +263,16 @@ var formats = [256]*struct {
263263 n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixStringCodeMin ), nil },
264264 more : true ,
265265 },
266- negFixIntCodeMin : {
267- t : Int ,
268- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (int64 (int8 (code ))), nil },
269- },
270266 nilCode : {
271267 t : Nil ,
272268 n : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
273269 },
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+ },
274276 falseCode : {
275277 t : Bool ,
276278 n : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
@@ -279,6 +281,36 @@ var formats = [256]*struct {
279281 t : Bool ,
280282 n : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
281283 },
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+ },
282314 float32Code : {
283315 t : Float ,
284316 n : func (d * Decoder , code byte ) (uint64 , error ) {
@@ -331,52 +363,6 @@ var formats = [256]*struct {
331363 t : Int ,
332364 n : (* Decoder ).read8 ,
333365 },
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- },
380366 fixExt1Code : {
381367 t : Extension ,
382368 n : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
@@ -402,26 +388,40 @@ var formats = [256]*struct {
402388 n : func (d * Decoder , code byte ) (uint64 , error ) { return 16 , nil },
403389 more : true ,
404390 },
405- ext8Code : {
406- t : Extension ,
391+ string8Code : {
392+ t : String ,
407393 n : (* Decoder ).read1 ,
408394 more : true ,
409395 },
410- ext16Code : {
411- t : Extension ,
396+ string16Code : {
397+ t : String ,
412398 n : (* Decoder ).read2 ,
413399 more : true ,
414400 },
415- ext32Code : {
416- t : Extension ,
401+ string32Code : {
402+ t : String ,
417403 n : (* Decoder ).read4 ,
418404 more : true ,
419405 },
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 },
425425 },
426426}
427427
0 commit comments