diff --git a/cgo.md b/cgo.md index f98bf23a..3dd0d3b7 100644 --- a/cgo.md +++ b/cgo.md @@ -126,6 +126,9 @@ func register(fn func(C.int)) int { mu.Lock() defer mu.Unlock() index++ + for fns[index] != nil { + index++ + } fns[index] = fn return index }