Last active
November 24, 2020 12:19
-
-
Save LarryLuTW/12ba294967245491795694a154fe8473 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type T1 struct { | |
f1 int8 // 1 byte | |
f2 int64 // 8 bytes | |
f3 int32 // 4 bytes | |
} | |
func main() { | |
t1 := T1{} | |
fmt.Println(unsafe.Sizeof(t1)) // 24 bytes | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment