From 3849c7f52a4d923013685d6b7303daae9132fafe Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 27 Aug 2019 10:02:12 -0700 Subject: make Delta and DiffLineType stringers --- diff.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'diff.go') diff --git a/diff.go b/diff.go index b025edd..1756217 100644 --- a/diff.go +++ b/diff.go @@ -39,6 +39,8 @@ const ( DeltaConflicted Delta = C.GIT_DELTA_CONFLICTED ) +//go:generate stringer -type Delta -trimprefix Delta -tags static + type DiffLineType int const ( @@ -54,6 +56,8 @@ const ( DiffLineBinary DiffLineType = C.GIT_DIFF_LINE_BINARY ) +//go:generate stringer -type DiffLineType -trimprefix DiffLine -tags static + type DiffFile struct { Path string Oid *Oid -- cgit v1.2.3 From 79b2cb6ca1aae4a9f442291fd88e37ef9b52ff2a Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Tue, 27 Aug 2019 10:23:37 -0700 Subject: provide param names in DiffForEachFileCallback Without a parameter name, the float64 param is pretty inscrutable. --- diff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diff.go') diff --git a/diff.go b/diff.go index b025edd..a5d1a61 100644 --- a/diff.go +++ b/diff.go @@ -284,7 +284,7 @@ type diffForEachData struct { Error error } -type DiffForEachFileCallback func(DiffDelta, float64) (DiffForEachHunkCallback, error) +type DiffForEachFileCallback func(delta DiffDelta, progress float64) (DiffForEachHunkCallback, error) type DiffDetail int -- cgit v1.2.3