Files
deep_go/lessons/structs/alignment_functions/main.go

20 lines
195 B
Go
Raw Normal View History

package main
import (
"fmt"
"unsafe"
)
type data struct {
aaa bool
bbb int32
ccc bool
}
func main() {
d := data{}
fmt.Println(unsafe.Offsetof(d.ccc))
fmt.Println(unsafe.Alignof(d))
}