func NewA() A { return A{10} } ...(snip)... func main() { a := sub.NewA() v := reflect.ValueOf(a).FieldByName("a") p := unsafe.Pointer(v.UnsafeAddr()) ptr := (*int)(p) *ptr = 100 fmt.Println(a) } panic: reflect.Value.UnsafeAddr of unaddressable value