Skip to content

Commit

Permalink
Issue #136 resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
darccio committed May 17, 2020
1 parent 1743a17 commit ea5937a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions issue136_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit ea5937a

Please sign in to comment.