From 1a200ed2e812f87a1bba5d2caae725793235448c Mon Sep 17 00:00:00 2001 From: Michael Boulton Date: Fri, 14 Aug 2020 15:10:09 +0100 Subject: [PATCH] Fix error return --- status.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/status.go b/status.go index 570de3a..3923e1a 100644 --- a/status.go +++ b/status.go @@ -6,6 +6,7 @@ package git import "C" import ( + "errors" "runtime" "unsafe" ) @@ -87,7 +88,7 @@ func (statusList *StatusList) ByIndex(index int) (StatusEntry, error) { } ptr := C.git_status_byindex(statusList.ptr, C.size_t(index)) if ptr == nil { - return StatusEntry{}, fmt.Errorf("Index out of Bounds") + return StatusEntry{}, errors.New("index out of Bounds") } entry := statusEntryFromC(ptr) runtime.KeepAlive(statusList)