fix: 修复 golangci-lint 报告的 5 个问题
- gofmt: 修复 admin_service/antigravity_oauth_service/token_refresh_service 格式 - staticcheck S1009: 移除 SetUserSettingsResponse.IsSuccess 中冗余的 nil 检查 - unused: 将仅测试使用的 applyAntigravitySubscriptionResult 移至测试文件 Made-with: Cursor
This commit is contained in:
@@ -36,27 +36,3 @@ func NormalizeAntigravitySubscription(resp *antigravity.LoadCodeAssistResponse)
|
||||
PlanType: antigravity.TierIDToPlanType(tierID),
|
||||
}
|
||||
}
|
||||
|
||||
func applyAntigravitySubscriptionResult(account *Account, result AntigravitySubscriptionResult) (map[string]any, map[string]any) {
|
||||
credentials := make(map[string]any)
|
||||
for k, v := range account.Credentials {
|
||||
credentials[k] = v
|
||||
}
|
||||
credentials["plan_type"] = result.PlanType
|
||||
|
||||
extra := make(map[string]any)
|
||||
for k, v := range account.Extra {
|
||||
extra[k] = v
|
||||
}
|
||||
if result.SubscriptionStatus != "" {
|
||||
extra["subscription_status"] = result.SubscriptionStatus
|
||||
} else {
|
||||
delete(extra, "subscription_status")
|
||||
}
|
||||
if result.SubscriptionError != "" {
|
||||
extra["subscription_error"] = result.SubscriptionError
|
||||
} else {
|
||||
delete(extra, "subscription_error")
|
||||
}
|
||||
return credentials, extra
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user