fix(lint): 修复 golangci-lint 检查问题
- usage_service: 修复 tx.Rollback 未检查错误返回值 (errcheck) - antigravity_gateway: 修复重试逻辑中的无效赋值 (ineffassign) - antigravity_gateway: 完善重试成功/失败的分支逻辑
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user