diff options
| author | Patrick Steinhardt <[email protected]> | 2015-05-22 08:58:21 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <[email protected]> | 2015-05-22 09:02:39 +0200 |
| commit | d95932c84a2b9c926490def345d71d45bb19f344 (patch) | |
| tree | 0bee427365b50cefea283382f40875f109ca0e6a /index.go | |
| parent | a843b7247f24a2125c30c865f9d8ea706ce3d768 (diff) | |
handles: panic when we cannot retrieve handle data
Diffstat (limited to 'index.go')
| -rw-r--r-- | index.go | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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") } } |
