Update status.go
Add suggested error message on return Co-authored-by: lhchavez <lhchavez@lhchavez.com>
This commit is contained in:
parent
1e38283adb
commit
faa4e293ba
|
@ -87,9 +87,7 @@ func (statusList *StatusList) ByIndex(index int) (StatusEntry, error) {
|
||||||
}
|
}
|
||||||
ptr := C.git_status_byindex(statusList.ptr, C.size_t(index))
|
ptr := C.git_status_byindex(statusList.ptr, C.size_t(index))
|
||||||
if ptr == nil {
|
if ptr == nil {
|
||||||
runtime.LockOSThread()
|
return StatusEntry{}, fmt.Errorf("Index out of Bounds")
|
||||||
defer runtime.UnlockOSThread()
|
|
||||||
return StatusEntry{}, MakeGitError(C.int(ErrNotFound))
|
|
||||||
}
|
}
|
||||||
entry := statusEntryFromC(ptr)
|
entry := statusEntryFromC(ptr)
|
||||||
runtime.KeepAlive(statusList)
|
runtime.KeepAlive(statusList)
|
||||||
|
|
Loading…
Reference in New Issue