Package list golang-github-imdario-mergo / 1624953e-2fd5-40e3-838c-a47f538e1c56/main issue61_test.go
1624953e-2fd5-40e3-838c-a47f538e1c56/main

Tree @1624953e-2fd5-40e3-838c-a47f538e1c56/main (Download .tar.gz)

issue61_test.go @1624953e-2fd5-40e3-838c-a47f538e1c56/mainraw · history · blame

package mergo

import (
	"reflect"
	"testing"
)

func TestIssue61MergeNilMap(t *testing.T) {
	type T struct {
		I map[string][]string
	}
	t1 := T{}
	t2 := T{I: map[string][]string{"hi": {"there"}}}
	if err := Merge(&t1, t2); err != nil {
		t.Fail()
	}
	if !reflect.DeepEqual(t2, T{I: map[string][]string{"hi": {"there"}}}) {
		t.FailNow()
	}
}