From d95932c84a2b9c926490def345d71d45bb19f344 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Fri, 22 May 2015 08:58:21 +0200 Subject: handles: panic when we cannot retrieve handle data --- index.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'index.go') diff --git a/index.go b/index.go index c344bf8..c1bfb74 100644 --- a/index.go +++ b/index.go @@ -234,12 +234,10 @@ func (v *Index) RemoveAll(pathspecs []string, callback IndexMatchedPathCallback) //export indexMatchedPathCallback func indexMatchedPathCallback(cPath, cMatchedPathspec *C.char, payload unsafe.Pointer) int { - if payload == nil { - return 0 - } else if callback, ok := pointerHandles.Get(payload).(IndexMatchedPathCallback); ok { + if callback, ok := pointerHandles.Get(payload).(IndexMatchedPathCallback); ok { return callback(C.GoString(cPath), C.GoString(cMatchedPathspec)) } else { - return -1 + panic("invalid matched path callback") } } -- cgit v1.2.3