Codebase list golang-github-imdario-mergo / c0bd9d15-5c14-408d-92dc-10704832b2fd/upstream/0.3.13+git20230113.1.12567bf pr80_test.go
c0bd9d15-5c14-408d-92dc-10704832b2fd/upstream/0.3.13+git20230113.1.12567bf

Tree @c0bd9d15-5c14-408d-92dc-10704832b2fd/upstream/0.3.13+git20230113.1.12567bf (Download .tar.gz)

pr80_test.go @c0bd9d15-5c14-408d-92dc-10704832b2fd/upstream/0.3.13+git20230113.1.12567bfraw · history · blame

package mergo_test

import (
	"testing"

	"github.com/imdario/mergo"
)

type mapInterface map[string]interface{}

func TestMergeMapsEmptyString(t *testing.T) {
	a := mapInterface{"s": ""}
	b := mapInterface{"s": "foo"}
	if err := mergo.Merge(&a, b); err != nil {
		t.Error(err)
	}
	if a["s"] != "foo" {
		t.Errorf("b not merged in properly: a.s.Value(%s) != expected(%s)", a["s"], "foo")
	}
}