@@ -374,6 +374,8 @@ func (d *ReflectionDecoder) unmarshalBool(
374
374
result .Set (reflect .ValueOf (value ))
375
375
return newOffset , nil
376
376
}
377
+ default :
378
+ // Fall through to error return
377
379
}
378
380
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
379
381
}
@@ -400,6 +402,8 @@ func (d *ReflectionDecoder) unmarshalBytes(
400
402
result .Set (reflect .ValueOf (value ))
401
403
return newOffset , nil
402
404
}
405
+ default :
406
+ // Fall through to error return
403
407
}
404
408
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
405
409
}
@@ -421,6 +425,8 @@ func (d *ReflectionDecoder) unmarshalFloat32(
421
425
result .Set (reflect .ValueOf (value ))
422
426
return newOffset , nil
423
427
}
428
+ default :
429
+ // Fall through to error return
424
430
}
425
431
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
426
432
}
@@ -445,6 +451,8 @@ func (d *ReflectionDecoder) unmarshalFloat64(
445
451
result .Set (reflect .ValueOf (value ))
446
452
return newOffset , nil
447
453
}
454
+ default :
455
+ // Fall through to error return
448
456
}
449
457
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
450
458
}
@@ -481,6 +489,8 @@ func (d *ReflectionDecoder) unmarshalInt32(
481
489
result .Set (reflect .ValueOf (value ))
482
490
return newOffset , nil
483
491
}
492
+ default :
493
+ // Fall through to error return
484
494
}
485
495
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
486
496
}
@@ -492,8 +502,6 @@ func (d *ReflectionDecoder) unmarshalMap(
492
502
depth int ,
493
503
) (uint , error ) {
494
504
switch result .Kind () {
495
- default :
496
- return 0 , mmdberrors .NewUnmarshalTypeStrError ("map" , result .Type ())
497
505
case reflect .Struct :
498
506
return d .decodeStruct (size , offset , result , depth )
499
507
case reflect .Map :
@@ -508,6 +516,8 @@ func (d *ReflectionDecoder) unmarshalMap(
508
516
return newOffset , err
509
517
}
510
518
return 0 , mmdberrors .NewUnmarshalTypeStrError ("map" , result .Type ())
519
+ default :
520
+ return 0 , mmdberrors .NewUnmarshalTypeStrError ("map" , result .Type ())
511
521
}
512
522
}
513
523
@@ -556,6 +566,8 @@ func (d *ReflectionDecoder) unmarshalSlice(
556
566
result .Set (rv .Value )
557
567
return newOffset , err
558
568
}
569
+ default :
570
+ // Fall through to error return
559
571
}
560
572
return 0 , mmdberrors .NewUnmarshalTypeStrError ("array" , result .Type ())
561
573
}
@@ -578,6 +590,8 @@ func (d *ReflectionDecoder) unmarshalString(
578
590
result .Set (reflect .ValueOf (value ))
579
591
return newOffset , nil
580
592
}
593
+ default :
594
+ // Fall through to error return
581
595
}
582
596
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
583
597
}
@@ -632,6 +646,8 @@ func (d *ReflectionDecoder) unmarshalUint(
632
646
result .SetUint (value )
633
647
return newOffset , nil
634
648
}
649
+ default :
650
+ // Fall through to general unmarshaling logic
635
651
}
636
652
637
653
switch result .Kind () {
@@ -656,6 +672,8 @@ func (d *ReflectionDecoder) unmarshalUint(
656
672
result .Set (reflect .ValueOf (value ))
657
673
return newOffset , nil
658
674
}
675
+ default :
676
+ // Fall through to error return
659
677
}
660
678
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
661
679
}
@@ -691,6 +709,8 @@ func (d *ReflectionDecoder) unmarshalUint128(
691
709
result .Set (reflect .ValueOf (value ))
692
710
return newOffset , nil
693
711
}
712
+ default :
713
+ // Fall through to error return
694
714
}
695
715
return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
696
716
}
@@ -1210,6 +1230,8 @@ func (d *ReflectionDecoder) tryFastDecodeTyped(
1210
1230
addressableValue {result .Elem (), false },
1211
1231
expectedType .Elem (),
1212
1232
)
1233
+ default :
1234
+ // Type not supported for fast path
1213
1235
}
1214
1236
1215
1237
return 0 , false
0 commit comments