Memory-Alignment is a tool to help analyze layout of fields in struct in memory.
go get github.com/vearne/mem-aligin
package main
import (
"github.com/vearne/mem-align"
)
type Car struct {
flag bool
age int32
F1 int8
F2 int64
F3 []byte
Name string
F4 error
}
func main(){
memalign.PrintStructAlignment(Car{})
}