add golangci-lint.

This commit is contained in:
孟帅
2023-05-31 18:01:50 +08:00
parent 46604b51b2
commit fdc48b9335
17 changed files with 425 additions and 479 deletions

View File

@@ -15,12 +15,12 @@ import (
// Init 初始化上下文对象指针到上下文对象中,以便后续的请求流程中可以修改
func Init(r *ghttp.Request, customCtx *model.Context) {
r.SetCtxVar(consts.ContextKey, customCtx)
r.SetCtxVar(consts.ContextHTTPKey, customCtx)
}
// Get 获得上下文变量如果没有设置那么返回nil
func Get(ctx context.Context) *model.Context {
value := ctx.Value(consts.ContextKey)
value := ctx.Value(consts.ContextHTTPKey)
if value == nil {
return nil
}