@@ -172,7 +172,7 @@ func (d *Decoder) Unpack() error {
172
172
f := formats [code ]
173
173
d .t = f .t
174
174
175
- d .n , err = f .n (d , code )
175
+ d .n , err = f .fn (d , code )
176
176
if err != nil {
177
177
return d .fatal (err )
178
178
}
@@ -243,185 +243,185 @@ func (d *Decoder) skipCount() int {
243
243
244
244
var formats = [256 ]* struct {
245
245
t Type
246
- n func (d * Decoder , code byte ) (uint64 , error )
246
+ fn func (d * Decoder , code byte ) (uint64 , error )
247
247
more bool
248
248
}{
249
249
fixIntCodeMin : {
250
- t : Int ,
251
- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ), nil },
250
+ t : Int ,
251
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ), nil },
252
252
},
253
253
fixMapCodeMin : {
254
- t : MapLen ,
255
- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixMapCodeMin ), nil },
254
+ t : MapLen ,
255
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixMapCodeMin ), nil },
256
256
},
257
257
fixArrayCodeMin : {
258
- t : ArrayLen ,
259
- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixArrayCodeMin ), nil },
258
+ t : ArrayLen ,
259
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixArrayCodeMin ), nil },
260
260
},
261
261
fixStringCodeMin : {
262
262
t : String ,
263
- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixStringCodeMin ), nil },
263
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (code ) - uint64 (fixStringCodeMin ), nil },
264
264
more : true ,
265
265
},
266
266
nilCode : {
267
- t : Nil ,
268
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
267
+ t : Nil ,
268
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
269
269
},
270
270
unusedCode : {
271
271
t : Invalid ,
272
- n : func (d * Decoder , code byte ) (uint64 , error ) {
272
+ fn : func (d * Decoder , code byte ) (uint64 , error ) {
273
273
return 0 , fmt .Errorf ("msgpack: unknown format code %x" , code )
274
274
},
275
275
},
276
276
falseCode : {
277
- t : Bool ,
278
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
277
+ t : Bool ,
278
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 0 , nil },
279
279
},
280
280
trueCode : {
281
- t : Bool ,
282
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
281
+ t : Bool ,
282
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
283
283
},
284
284
binary8Code : {
285
285
t : Binary ,
286
- n : (* Decoder ).read1 ,
286
+ fn : (* Decoder ).read1 ,
287
287
more : true ,
288
288
},
289
289
binary16Code : {
290
290
t : Binary ,
291
- n : (* Decoder ).read2 ,
291
+ fn : (* Decoder ).read2 ,
292
292
more : true ,
293
293
},
294
294
binary32Code : {
295
295
t : Binary ,
296
- n : (* Decoder ).read4 ,
296
+ fn : (* Decoder ).read4 ,
297
297
more : true ,
298
298
},
299
299
ext8Code : {
300
300
t : Extension ,
301
- n : (* Decoder ).read1 ,
301
+ fn : (* Decoder ).read1 ,
302
302
more : true ,
303
303
},
304
304
ext16Code : {
305
305
t : Extension ,
306
- n : (* Decoder ).read2 ,
306
+ fn : (* Decoder ).read2 ,
307
307
more : true ,
308
308
},
309
309
ext32Code : {
310
310
t : Extension ,
311
- n : (* Decoder ).read4 ,
311
+ fn : (* Decoder ).read4 ,
312
312
more : true ,
313
313
},
314
314
float32Code : {
315
315
t : Float ,
316
- n : func (d * Decoder , code byte ) (uint64 , error ) {
316
+ fn : func (d * Decoder , code byte ) (uint64 , error ) {
317
317
n , err := d .read4 (code )
318
318
return math .Float64bits (float64 (math .Float32frombits (uint32 (n )))), err
319
319
},
320
320
},
321
321
float64Code : {
322
- t : Float ,
323
- n : (* Decoder ).read8 ,
322
+ t : Float ,
323
+ fn : (* Decoder ).read8 ,
324
324
},
325
325
uint8Code : {
326
- t : Uint ,
327
- n : (* Decoder ).read1 ,
326
+ t : Uint ,
327
+ fn : (* Decoder ).read1 ,
328
328
},
329
329
uint16Code : {
330
- t : Uint ,
331
- n : (* Decoder ).read2 ,
330
+ t : Uint ,
331
+ fn : (* Decoder ).read2 ,
332
332
},
333
333
uint32Code : {
334
- t : Uint ,
335
- n : (* Decoder ).read4 ,
334
+ t : Uint ,
335
+ fn : (* Decoder ).read4 ,
336
336
},
337
337
uint64Code : {
338
- t : Uint ,
339
- n : (* Decoder ).read8 ,
338
+ t : Uint ,
339
+ fn : (* Decoder ).read8 ,
340
340
},
341
341
int8Code : {
342
342
t : Int ,
343
- n : func (d * Decoder , code byte ) (uint64 , error ) {
343
+ fn : func (d * Decoder , code byte ) (uint64 , error ) {
344
344
n , err := d .read1 (code )
345
345
return uint64 (int64 (int8 (n ))), err
346
346
},
347
347
},
348
348
int16Code : {
349
349
t : Int ,
350
- n : func (d * Decoder , code byte ) (uint64 , error ) {
350
+ fn : func (d * Decoder , code byte ) (uint64 , error ) {
351
351
n , err := d .read2 (code )
352
352
return uint64 (int64 (int16 (n ))), err
353
353
},
354
354
},
355
355
int32Code : {
356
356
t : Int ,
357
- n : func (d * Decoder , code byte ) (uint64 , error ) {
357
+ fn : func (d * Decoder , code byte ) (uint64 , error ) {
358
358
n , err := d .read4 (code )
359
359
return uint64 (int64 (int32 (n ))), err
360
360
},
361
361
},
362
362
int64Code : {
363
- t : Int ,
364
- n : (* Decoder ).read8 ,
363
+ t : Int ,
364
+ fn : (* Decoder ).read8 ,
365
365
},
366
366
fixExt1Code : {
367
367
t : Extension ,
368
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
368
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 1 , nil },
369
369
more : true ,
370
370
},
371
371
fixExt2Code : {
372
372
t : Extension ,
373
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 2 , nil },
373
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 2 , nil },
374
374
more : true ,
375
375
},
376
376
fixExt4Code : {
377
377
t : Extension ,
378
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 4 , nil },
378
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 4 , nil },
379
379
more : true ,
380
380
},
381
381
fixExt8Code : {
382
382
t : Extension ,
383
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 8 , nil },
383
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 8 , nil },
384
384
more : true ,
385
385
},
386
386
fixExt16Code : {
387
387
t : Extension ,
388
- n : func (d * Decoder , code byte ) (uint64 , error ) { return 16 , nil },
388
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return 16 , nil },
389
389
more : true ,
390
390
},
391
391
string8Code : {
392
392
t : String ,
393
- n : (* Decoder ).read1 ,
393
+ fn : (* Decoder ).read1 ,
394
394
more : true ,
395
395
},
396
396
string16Code : {
397
397
t : String ,
398
- n : (* Decoder ).read2 ,
398
+ fn : (* Decoder ).read2 ,
399
399
more : true ,
400
400
},
401
401
string32Code : {
402
402
t : String ,
403
- n : (* Decoder ).read4 ,
403
+ fn : (* Decoder ).read4 ,
404
404
more : true ,
405
405
},
406
406
array16Code : {
407
- t : ArrayLen ,
408
- n : (* Decoder ).read2 ,
407
+ t : ArrayLen ,
408
+ fn : (* Decoder ).read2 ,
409
409
},
410
410
array32Code : {
411
- t : ArrayLen ,
412
- n : (* Decoder ).read4 ,
411
+ t : ArrayLen ,
412
+ fn : (* Decoder ).read4 ,
413
413
},
414
414
map16Code : {
415
- t : MapLen ,
416
- n : (* Decoder ).read2 ,
415
+ t : MapLen ,
416
+ fn : (* Decoder ).read2 ,
417
417
},
418
418
map32Code : {
419
- t : MapLen ,
420
- n : (* Decoder ).read4 ,
419
+ t : MapLen ,
420
+ fn : (* Decoder ).read4 ,
421
421
},
422
422
negFixIntCodeMin : {
423
- t : Int ,
424
- n : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (int64 (int8 (code ))), nil },
423
+ t : Int ,
424
+ fn : func (d * Decoder , code byte ) (uint64 , error ) { return uint64 (int64 (int8 (code ))), nil },
425
425
},
426
426
}
427
427
0 commit comments