golang查看panic详细对战信息

defer func() {
        if e := recover(); e != nil {
            var buf [4096]byte
            n := runtime.Stack(buf[:], false)
            fmt.Println(string(buf[:n]))
        }
    }()

 

posted @ 2021-11-19 17:32  许伟强  阅读(201)  评论(0编辑  收藏  举报