Last active
June 17, 2016 16:51
-
-
Save kevin-cantwell/86e6ee62f2063dae59530d391a1d8669 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "unsafe" | |
| ) | |
| func main() { | |
| type Foo struct { | |
| a int32 | |
| b int32 | |
| c int32 | |
| d int32 | |
| } | |
| var foo *Foo | |
| var bar *int32 | |
| fmt.Println(unsafe.Sizeof(foo)) // prints 8 on 64-bit architectures, 4 on 32-bit | |
| fmt.Println(unsafe.Sizeof(bar)) // prints 8 on 64-bit architectures, 4 on 32-bit | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment