add case
This commit is contained in:
parent
3173e66166
commit
533c3d1be0
Binary file not shown.
|
@ -2,6 +2,9 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"runtime/debug"
|
||||
"time"
|
||||
|
||||
emitter "git.pyer.club/kingecg/goemitter"
|
||||
)
|
||||
|
@ -30,5 +33,12 @@ func main() {
|
|||
})
|
||||
em.EmitSync("test", "hello", "world")
|
||||
em.Emit("test", "hello", "world2")
|
||||
select {}
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println("Recovered in main:", r)
|
||||
// 打印当前所有 goroutine 的堆栈信息
|
||||
log.Println(string(debug.Stack()))
|
||||
}
|
||||
}()
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue