# ./main.go:12:9: 未定义：foo.Bar

- **ID:** `go/undefined-symbol`
- **领域:** go
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

所引用的标识符在导入的包中不存在（被重命名、未导出，或版本不对）。常见于依赖升级后。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   go doc github.com/foo/bar.Bar
go doc github.com/foo/bar | grep -i bar
   ```
2. **** (85% 成功率)
   ```
   go get github.com/foo/bar@v1.2.0
go mod tidy
   ```

## 无效尝试

- **** — the symbol still does not exist in that package (95% 失败率)
- **** — undefined symbols are compile errors, not vet warnings (100% 失败率)
- **** — invalid syntax; cannot shadow package members (100% 失败率)
