Skip to content

Commit

Permalink
Issue #83 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
darccio committed Jul 17, 2020
1 parent 258c11b commit ad21779
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions issue83_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package mergo

import "testing"

type issue83My struct {
Data []int
}

func TestIssue83(t *testing.T) {
dst := issue83My{Data: []int{1, 2, 3}}
new := issue83My{}
if err := Merge(&dst, new, WithOverwriteWithEmptyValue); err != nil {
t.Error(err)
}
if len(dst.Data) > 0 {
t.Errorf("expected empty slice, got %v", dst.Data)
}
}

0 comments on commit ad21779

Please sign in to comment.