فهرست منبع

fix context bug

dcsunny 4 سال پیش
والد
کامیت
d495c08a70
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      common/context.go

+ 3 - 3
common/context.go

@@ -14,9 +14,9 @@ func NewContext(parentCtx context.Context) context.Context {
 
 func NewContextWithAccountID(parentCtx context.Context, accountID int64) context.Context {
 	ctx := &AccountContext{ctx: parentCtx}
-	ctx = context2.AppendToContext(ctx, "user_id", accountID).(*AccountContext)
-	ctx = context2.AppendToContext(ctx, "account_id", accountID).(*AccountContext)
-	return ctx
+	newCtx := context2.AppendToContext(ctx, "user_id", accountID)
+	newCtx = context2.AppendToContext(ctx, "account_id", accountID)
+	return newCtx
 }
 
 type AccountContext struct {