diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-01 02:41:14 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-01 02:41:14 -0600 |
commit | d6243eb7afd5d9d91686bce2e02c252be456b38c (patch) | |
tree | 11d5df97a41b211aa69777a020e00d47a8790329 /pkg/binstruct/size.go | |
parent | 4d3a645624cd6aafcd081edf8ef833ace27dfb87 (diff) |
better errors
Diffstat (limited to 'pkg/binstruct/size.go')
-rw-r--r-- | pkg/binstruct/size.go | 3 |
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()) |