{ x := internal.NewX("aaa") overwrite.Field(&x, "val", "bbb") if got, want := x.Get(), "bbb"; got != want { t.Errorf("got %v, want %v", got, want) } } package internal type X struct { val string } func (x X) Get()string { return x.val } func NewX(a string) X{ return X{a} }