Update status.go

Add suggested error message on return

Co-authored-by: lhchavez <lhchavez@lhchavez.com>
This commit is contained in:
michael boulton 2020-08-14 15:05:34 +01:00 committed by GitHub
parent 1e38283adb
commit faa4e293ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

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