我看到了很多代码片段,这些片段在golang中会恢复正常。就像这样:
func PanicRecover(c context.Context) {
if e := recover(); e != nil {
const size = 64 << 10
buf := make([]byte, size)
buf = buf[:runtime.Stack(buf, false)]
logs.CtxError(c, "Error: %s", string(buf))
}
}
我想知道为什么缓冲区大小总是64 << 10。