Quellcode durchsuchen

fix context bug

dcsunny vor 4 Jahren
Ursprung
Commit
d495c08a70
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  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 {