fix(lint): 修复 golangci-lint 检查问题

- usage_service: 修复 tx.Rollback 未检查错误返回值 (errcheck)
- antigravity_gateway: 修复重试逻辑中的无效赋值 (ineffassign)
- antigravity_gateway: 完善重试成功/失败的分支逻辑
This commit is contained in:
IanShaw027
2026-01-04 10:14:47 +08:00
parent aad4163d22
commit 537af60e33
2 changed files with 7 additions and 7 deletions

View File

@@ -441,13 +441,13 @@ func (s *AntigravityGatewayService) Forward(ctx context.Context, c *gin.Context,
_ = resp.Body.Close()
resp = retryResp
respBody = nil
} else {
// Retry still errored: replace error context with retry response.
retryBody, _ := io.ReadAll(io.LimitReader(retryResp.Body, 2<<20))
_ = retryResp.Body.Close()
respBody = retryBody
resp = retryResp
}
// Retry still errored: replace error context with retry response.
retryBody, _ := io.ReadAll(io.LimitReader(retryResp.Body, 2<<20))
_ = retryResp.Body.Close()
respBody = retryBody
resp = retryResp
} else {
log.Printf("Antigravity account %d: signature retry request failed: %v", account.ID, retryErr)
}

View File

@@ -78,7 +78,7 @@ func (s *UsageService) Create(ctx context.Context, req CreateUsageLogRequest) (*
txCtx := ctx
if err == nil {
defer tx.Rollback()
defer func() { _ = tx.Rollback() }()
txCtx = dbent.NewTxContext(ctx, tx)
}