From 8d5b5fdcff2f6d3ce45b7fed3afae6a22dc3352b Mon Sep 17 00:00:00 2001 From: Jacob Brewer Date: Mon, 13 Jan 2025 10:01:11 +0000 Subject: [PATCH] chore(utils): Adding example to a comment that explains how to use the func (#80) Adding example to a comment that explains how to use the func --- utils.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils.go b/utils.go index ea3ea39..df9f6be 100644 --- a/utils.go +++ b/utils.go @@ -22,6 +22,13 @@ func isPointerToStruct[T any](t T) bool { // 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. +// +// Example: +// +// err := report.Patch(db, newReport) +// if patcher.IgnoreNoChangesErr(err) != nil { +// return err +// } func IgnoreNoChangesErr(err error) error { switch { case errors.Is(err, ErrNoChanges):