diff --git a/issue136_test.go b/issue136_test.go new file mode 100644 index 0000000..57945d2 --- /dev/null +++ b/issue136_test.go @@ -0,0 +1,29 @@ +package mergo + +import ( + "testing" +) + +type embeddedTestA struct { + Name string + Age uint8 +} + +type embeddedTestB struct { + embeddedTestA + Address string +} + +func TestMergeEmbedded(t *testing.T) { + a := &embeddedTestA{ + "Suwon", 16, + } + + b := &embeddedTestB{} + + err := Merge(&b.embeddedTestA, *a) + + if b.Name != "Suwon" { + t.Fatalf("%v %v", b.Name, err) + } +}