v0.0.214 reassign innerctx
This commit is contained in:
@@ -15,7 +15,7 @@ type AppContext struct {
|
||||
|
||||
func CreateAppContext(g *gin.Context, innerCtx context.Context, cancelFn context.CancelFunc) *AppContext {
|
||||
for key, value := range g.Keys {
|
||||
context.WithValue(innerCtx, key, value)
|
||||
innerCtx = context.WithValue(innerCtx, key, value)
|
||||
}
|
||||
return &AppContext{
|
||||
inner: innerCtx,
|
||||
@@ -42,7 +42,7 @@ func (ac *AppContext) Value(key any) any {
|
||||
}
|
||||
|
||||
func (ac *AppContext) Set(key, value any) {
|
||||
context.WithValue(ac.inner, key, value)
|
||||
ac.inner = context.WithValue(ac.inner, key, value)
|
||||
}
|
||||
|
||||
func (ac *AppContext) Cancel() {
|
||||
|
Reference in New Issue
Block a user