Исходники и презентации
This commit is contained in:
16
lessons/structs/empty_struct_size/main.go
Normal file
16
lessons/structs/empty_struct_size/main.go
Normal file
@ -0,0 +1,16 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type data struct{}
|
||||
|
||||
func main() {
|
||||
x := &data{}
|
||||
y := data{}
|
||||
|
||||
fmt.Println(unsafe.Sizeof(x))
|
||||
fmt.Println(unsafe.Sizeof(y))
|
||||
}
|
||||
Reference in New Issue
Block a user