1 package mergo_test 2 3 import ( 4 "reflect" 5 "testing" 6 7 "dario.cat/mergo" 8 ) 9 10 func TestIssue61MergeNilMap(t *testing.T) { 11 type T struct { 12 I map[string][]string 13 } 14 t1 := T{} 15 t2 := T{I: map[string][]string{"hi": {"there"}}} 16 17 if err := mergo.Merge(&t1, t2); err != nil { 18 t.Fail() 19 } 20 21 if !reflect.DeepEqual(t2, T{I: map[string][]string{"hi": {"there"}}}) { 22 t.FailNow() 23 } 24 } 25