summaryrefslogtreecommitdiff
path: root/pkg/binstruct/size.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-05-30 12:11:14 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2022-05-30 12:11:14 -0400
commit5cc9d7718fecd0b2b91dcf5acb5d92316c752570 (patch)
treeb32fe8da4ef71b9c53d7203b62b5aade6757d2f7 /pkg/binstruct/size.go
parent703e98f2759148aa2d6ac80f2519ae8e41da3e95 (diff)
x
Diffstat (limited to 'pkg/binstruct/size.go')
-rw-r--r--pkg/binstruct/size.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/binstruct/size.go b/pkg/binstruct/size.go
index f6b3241..8846c23 100644
--- a/pkg/binstruct/size.go
+++ b/pkg/binstruct/size.go
@@ -26,6 +26,12 @@ func staticSize(typ reflect.Type) (int, error) {
switch typ.Kind() {
case reflect.Uint8, reflect.Int8:
return 1, nil
+ case reflect.Uint16, reflect.Int16:
+ return 2, nil
+ case reflect.Uint32, reflect.Int32:
+ return 4, nil
+ case reflect.Uint64, reflect.Int64:
+ return 8, nil
case reflect.Ptr:
return staticSize(typ.Elem())
case reflect.Array: