diff --git a/sql_test.go b/sql_test.go index 2c7416a..5e52586 100644 --- a/sql_test.go +++ b/sql_test.go @@ -417,7 +417,7 @@ func (s *NewDiffSQLPatchSuite) TestNewDiffSQLPatch_Success_ignoreNoChanges() { } patch, err := NewDiffSQLPatch(&obj, &obj2) - s.NoError(IgnoreNoChanges(err)) + s.NoError(IgnoreNoChangesErr(err)) s.Nil(patch) } @@ -439,7 +439,7 @@ func (s *NewDiffSQLPatchSuite) TestNewDiffSQLPatch_Success_ignoreNoChanges_wrapp patch, err := NewDiffSQLPatch(&obj, &obj2) if err != nil { - err = IgnoreNoChanges(fmt.Errorf("wrapped: %w", err)) + err = IgnoreNoChangesErr(fmt.Errorf("wrapped: %w", err)) } s.NoError(err) s.Nil(patch) diff --git a/utils.go b/utils.go index 1645096..ea3ea39 100644 --- a/utils.go +++ b/utils.go @@ -19,10 +19,10 @@ func isPointerToStruct[T any](t T) bool { return rv.Elem().Kind() == reflect.Struct } -// IgnoreNoChanges ignores the ErrNoChanges error. This is useful when you want to ignore the error when no changes +// IgnoreNoChangesErr ignores the ErrNoChanges error. This is useful when you want to ignore the error when no changes // were made. Please ensure that you are still handling the errors as needed. We will return a "nil" patch when there // are no changes as the ErrNoChanges error is returned. -func IgnoreNoChanges(err error) error { +func IgnoreNoChangesErr(err error) error { switch { case errors.Is(err, ErrNoChanges): return nil