fix(lint): 修复 golangci-lint 检查错误

- 修复未检查的错误返回值 (errcheck)
- 移除未使用的 httpClient 字段 (unused)
- 修复低效赋值问题 (ineffassign)
- 使用 switch 替代 if-else 链 (staticcheck QF1003)
- 修复错误字符串首字母大写问题 (staticcheck ST1005)
- 运行 gofmt 格式化代码
This commit is contained in:
IanShaw027
2026-01-01 14:07:37 +08:00
parent 7df914af06
commit 34bbfb5dd2
3 changed files with 27 additions and 27 deletions

View File

@@ -1023,6 +1023,10 @@ func (h *AccountHandler) RefreshTier(c *gin.Context) {
}
tierID, storageInfo, err := h.geminiOAuthService.FetchGoogleOneTier(c.Request.Context(), accessToken, proxyURL)
if err != nil {
response.ErrorFrom(c, err)
return
}
if account.Extra == nil {
account.Extra = make(map[string]any)
@@ -1044,10 +1048,10 @@ func (h *AccountHandler) RefreshTier(c *gin.Context) {
}
response.Success(c, gin.H{
"tier_id": tierID,
"drive_storage_limit": account.Extra["drive_storage_limit"],
"drive_storage_usage": account.Extra["drive_storage_usage"],
"updated_at": account.Extra["drive_tier_updated_at"],
"tier_id": tierID,
"drive_storage_limit": account.Extra["drive_storage_limit"],
"drive_storage_usage": account.Extra["drive_storage_usage"],
"updated_at": account.Extra["drive_tier_updated_at"],
})
}