summaryrefslogtreecommitdiff
path: root/pkg/binstruct/size.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/binstruct/size.go')
-rw-r--r--pkg/binstruct/size.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/binstruct/size.go b/pkg/binstruct/size.go
index 0119a7a..6563455 100644
--- a/pkg/binstruct/size.go
+++ b/pkg/binstruct/size.go
@@ -48,7 +48,8 @@ func staticSize(typ reflect.Type) (int, error) {
if !(typ.Implements(marshalerType) || typ.Implements(unmarshalerType)) {
return getStructHandler(typ).Size, nil
}
- fallthrough
+ return 0, fmt.Errorf("type=%v (kind=%v) does not implement binfmt.StaticSizer but does implement binfmt.Marshaler or binfmt.Unmarshaler",
+ typ, typ.Kind())
default:
return 0, fmt.Errorf("type=%v does not implement binfmt.StaticSizer and kind=%v is not a supported statically-sized kind",
typ, typ.Kind())