From ad65e109e4bc99d099a501de14c8b8bdb32724ca Mon Sep 17 00:00:00 2001 From: Michael Boulton Date: Mon, 17 Aug 2020 08:02:18 +0100 Subject: [PATCH] Do not embed callbacks in struct and give them more appropriate type names --- diff.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/diff.go b/diff.go index 94f5da5..1412ca9 100644 --- a/diff.go +++ b/diff.go @@ -850,17 +850,17 @@ func DiffBlobs(oldBlob *Blob, oldAsPath string, newBlob *Blob, newAsPath string, return nil } -type ApplyHunkCallback func(*DiffHunk) (apply bool, err error) -type ApplyDeltaCallback func(*DiffDelta) (apply bool, err error) +type ApplyHunkCb func(*DiffHunk) (apply bool, err error) +type ApplyDeltaCb func(*DiffDelta) (apply bool, err error) // ApplyOptions has 2 callbacks that are called for hunks or deltas // If these functions return an error, abort the apply process immediately. -// If the first resutnr value is true, the delta/hunk will be applied. If it is false, the delta/hunk will not be applied. In either case, the rest of the apply process will continue. +// If the first return value is true, the delta/hunk will be applied. If it is false, the delta/hunk will not be applied. In either case, the rest of the apply process will continue. type ApplyOptions struct { - Version uint - ApplyHunkCallback - ApplyDeltaCallback - Flags uint + Version uint + ApplyHunkCallback ApplyHunkCb + ApplyDeltaCallback ApplyDeltaCb + Flags uint } //export hunkApplyCallback