Created
February 13, 2021 14:13
-
-
Save romanitalian/dc30e5223267e385d3bc47faf72ab8ed 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" | |
) | |
type Foo struct { | |
} | |
func main() { | |
x := &Foo{} | |
y := Foo{} | |
fmt.Println(unsafe.Sizeof(x)) // 8 | |
fmt.Println(unsafe.Sizeof(y)) // 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment