@@ -374,6 +374,8 @@ func (d *ReflectionDecoder) unmarshalBool(
374374 result .Set (reflect .ValueOf (value ))
375375 return newOffset , nil
376376 }
377+ default :
378+ // Fall through to error return
377379 }
378380 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
379381}
@@ -400,6 +402,8 @@ func (d *ReflectionDecoder) unmarshalBytes(
400402 result .Set (reflect .ValueOf (value ))
401403 return newOffset , nil
402404 }
405+ default :
406+ // Fall through to error return
403407 }
404408 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
405409}
@@ -421,6 +425,8 @@ func (d *ReflectionDecoder) unmarshalFloat32(
421425 result .Set (reflect .ValueOf (value ))
422426 return newOffset , nil
423427 }
428+ default :
429+ // Fall through to error return
424430 }
425431 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
426432}
@@ -445,6 +451,8 @@ func (d *ReflectionDecoder) unmarshalFloat64(
445451 result .Set (reflect .ValueOf (value ))
446452 return newOffset , nil
447453 }
454+ default :
455+ // Fall through to error return
448456 }
449457 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
450458}
@@ -481,6 +489,8 @@ func (d *ReflectionDecoder) unmarshalInt32(
481489 result .Set (reflect .ValueOf (value ))
482490 return newOffset , nil
483491 }
492+ default :
493+ // Fall through to error return
484494 }
485495 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
486496}
@@ -492,8 +502,6 @@ func (d *ReflectionDecoder) unmarshalMap(
492502 depth int ,
493503) (uint , error ) {
494504 switch result .Kind () {
495- default :
496- return 0 , mmdberrors .NewUnmarshalTypeStrError ("map" , result .Type ())
497505 case reflect .Struct :
498506 return d .decodeStruct (size , offset , result , depth )
499507 case reflect .Map :
@@ -508,6 +516,8 @@ func (d *ReflectionDecoder) unmarshalMap(
508516 return newOffset , err
509517 }
510518 return 0 , mmdberrors .NewUnmarshalTypeStrError ("map" , result .Type ())
519+ default :
520+ return 0 , mmdberrors .NewUnmarshalTypeStrError ("map" , result .Type ())
511521 }
512522}
513523
@@ -556,6 +566,8 @@ func (d *ReflectionDecoder) unmarshalSlice(
556566 result .Set (rv .Value )
557567 return newOffset , err
558568 }
569+ default :
570+ // Fall through to error return
559571 }
560572 return 0 , mmdberrors .NewUnmarshalTypeStrError ("array" , result .Type ())
561573}
@@ -578,6 +590,8 @@ func (d *ReflectionDecoder) unmarshalString(
578590 result .Set (reflect .ValueOf (value ))
579591 return newOffset , nil
580592 }
593+ default :
594+ // Fall through to error return
581595 }
582596 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
583597}
@@ -632,6 +646,8 @@ func (d *ReflectionDecoder) unmarshalUint(
632646 result .SetUint (value )
633647 return newOffset , nil
634648 }
649+ default :
650+ // Fall through to general unmarshaling logic
635651 }
636652
637653 switch result .Kind () {
@@ -656,6 +672,8 @@ func (d *ReflectionDecoder) unmarshalUint(
656672 result .Set (reflect .ValueOf (value ))
657673 return newOffset , nil
658674 }
675+ default :
676+ // Fall through to error return
659677 }
660678 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
661679}
@@ -691,6 +709,8 @@ func (d *ReflectionDecoder) unmarshalUint128(
691709 result .Set (reflect .ValueOf (value ))
692710 return newOffset , nil
693711 }
712+ default :
713+ // Fall through to error return
694714 }
695715 return newOffset , mmdberrors .NewUnmarshalTypeError (value , result .Type ())
696716}
@@ -1210,6 +1230,8 @@ func (d *ReflectionDecoder) tryFastDecodeTyped(
12101230 addressableValue {result .Elem (), false },
12111231 expectedType .Elem (),
12121232 )
1233+ default :
1234+ // Type not supported for fast path
12131235 }
12141236
12151237 return 0 , false
0 commit comments