Do not embed callbacks in struct and give them more appropriate type names
This commit is contained in:
parent
87433ff8a8
commit
ad65e109e4
14
diff.go
14
diff.go
|
@ -850,17 +850,17 @@ func DiffBlobs(oldBlob *Blob, oldAsPath string, newBlob *Blob, newAsPath string,
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApplyHunkCallback func(*DiffHunk) (apply bool, err error)
|
type ApplyHunkCb func(*DiffHunk) (apply bool, err error)
|
||||||
type ApplyDeltaCallback func(*DiffDelta) (apply bool, err error)
|
type ApplyDeltaCb func(*DiffDelta) (apply bool, err error)
|
||||||
|
|
||||||
// ApplyOptions has 2 callbacks that are called for hunks or deltas
|
// ApplyOptions has 2 callbacks that are called for hunks or deltas
|
||||||
// If these functions return an error, abort the apply process immediately.
|
// 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 {
|
type ApplyOptions struct {
|
||||||
Version uint
|
Version uint
|
||||||
ApplyHunkCallback
|
ApplyHunkCallback ApplyHunkCb
|
||||||
ApplyDeltaCallback
|
ApplyDeltaCallback ApplyDeltaCb
|
||||||
Flags uint
|
Flags uint
|
||||||
}
|
}
|
||||||
|
|
||||||
//export hunkApplyCallback
|
//export hunkApplyCallback
|
||||||
|
|
Loading…
Reference in New Issue