summaryrefslogtreecommitdiff
path: root/pkg/binstruct/size.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-01 02:41:14 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-01 02:41:14 -0600
commitd6243eb7afd5d9d91686bce2e02c252be456b38c (patch)
tree11d5df97a41b211aa69777a020e00d47a8790329 /pkg/binstruct/size.go
parent4d3a645624cd6aafcd081edf8ef833ace27dfb87 (diff)
better errors
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())