# 调用 fmt.Sprintf 时参数过多

- **ID:** `go/too-many-arguments`
- **领域:** go
- **类别:** compile_error
- **验证级别:** ai_generated
- **修复率:** 95%

## 根因

传递给像 fmt.Sprintf 这样的可变参数函数的参数数量超过了格式字符串中的格式动词数量。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| go1.21 | active | — | — |
| go1.22 | active | — | — |
| go1.23 | active | — | — |

## 解决方案

1. ```
   Match the number of format verbs (%s, %d, etc.) to the number of arguments. Add or remove verbs as needed.
   ```
2. ```
   Use a single %v verb with a struct or map to capture multiple values if the exact format is flexible.
   ```

## 无效尝试

- **Removing all arguments except the format string.** — The format string likely contains verbs that need arguments; removing them will cause a different compile error about missing arguments. (90% 失败率)
- **Adding a newline to the format string.** — Newlines do not consume arguments; the mismatch persists. (95% 失败率)
