...

Source file src/github.com/imdario/mergo/issue61_test.go

Documentation: github.com/imdario/mergo

     1  package mergo_test
     2  
     3  import (
     4  	"reflect"
     5  	"testing"
     6  
     7  	"github.com/imdario/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  

View as plain text