Handler 包装
在 main.go
中加入新的 HTTP Handler 时需要使用 handlerWrapper
函数进行包装,以便做一些共性处理:
- panic recover
- 请求处理计时
原文: https://88250.gitbooks.io/wide-dev-guide/zh-cn/coding_conventions/handler.html
在 main.go
中加入新的 HTTP Handler 时需要使用 handlerWrapper
函数进行包装,以便做一些共性处理:
原文: https://88250.gitbooks.io/wide-dev-guide/zh-cn/coding_conventions/handler.html
本文档使用 BookStack 构建