Skip to content

Commit

Permalink
Merge pull request #170 from mdeltour/fix/naming-typo
Browse files Browse the repository at this point in the history
fix typo in error name
  • Loading branch information
darccio committed Mar 15, 2023
2 parents d19834b + 0d72cef commit 90db0ad
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion map.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {

func _map(dst, src interface{}, opts ...func(*Config)) error {
if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr {
return ErrNonPointerAgument
return ErrNonPointerArgument
}
var (
vDst, vSrc reflect.Value
Expand Down
2 changes: 1 addition & 1 deletion merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func WithSliceDeepCopy(config *Config) {

func merge(dst, src interface{}, opts ...func(*Config)) error {
if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr {
return ErrNonPointerAgument
return ErrNonPointerArgument
}
var (
vDst, vSrc reflect.Value
Expand Down
4 changes: 2 additions & 2 deletions merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestMergeNonPointer(t *testing.T) {
"a": "1",
},
}
want := mergo.ErrNonPointerAgument
want := mergo.ErrNonPointerArgument

if got := mergo.Merge(dst, src); got != want {
t.Errorf("want: %s, got: %s", want, got)
Expand All @@ -81,7 +81,7 @@ func TestMapNonPointer(t *testing.T) {
},
},
}
want := mergo.ErrNonPointerAgument
want := mergo.ErrNonPointerArgument
if got := mergo.Merge(dst, src); got != want {
t.Errorf("want: %s, got: %s", want, got)
}
Expand Down
2 changes: 1 addition & 1 deletion mergo.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
ErrNotSupported = errors.New("only structs, maps, and slices are supported")
ErrExpectedMapAsDestination = errors.New("dst was expected to be a map")
ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct")
ErrNonPointerAgument = errors.New("dst must be a pointer")
ErrNonPointerArgument = errors.New("dst must be a pointer")
)

// During deepMerge, must keep track of checks that are
Expand Down

0 comments on commit 90db0ad

Please sign in to comment.