From faa4e293bac16edcb585cf8c747fb49c61d378df Mon Sep 17 00:00:00 2001 From: michael boulton <61595820+mbfr@users.noreply.github.com> Date: Fri, 14 Aug 2020 15:05:34 +0100 Subject: [PATCH] Update status.go Add suggested error message on return Co-authored-by: lhchavez --- status.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/status.go b/status.go index 4e1196c..570de3a 100644 --- a/status.go +++ b/status.go @@ -87,9 +87,7 @@ func (statusList *StatusList) ByIndex(index int) (StatusEntry, error) { } ptr := C.git_status_byindex(statusList.ptr, C.size_t(index)) if ptr == nil { - runtime.LockOSThread() - defer runtime.UnlockOSThread() - return StatusEntry{}, MakeGitError(C.int(ErrNotFound)) + return StatusEntry{}, fmt.Errorf("Index out of Bounds") } entry := statusEntryFromC(ptr) runtime.KeepAlive(statusList)