Fix error return

This commit is contained in:
Michael Boulton 2020-08-14 15:10:09 +01:00
parent e22f95bd3c
commit 1a200ed2e8
No known key found for this signature in database
GPG Key ID: 8A62CA0BE2E0197E
1 changed files with 2 additions and 1 deletions

View File

@ -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)