go
build_error
ai_generated
true
恐慌:proto:文件 "common.proto" 已注册
panic: proto: file "common.proto" is already registered
ID: go/grpc-protobuf-import-error
80%修复率
88%置信度
0证据数
2024-03-30首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 1.30.0 | active | — | — | — |
根因分析
同一个 .proto 文件被多次导入和注册,通常是由于循环导入或重复导入。
English
The same .proto file is being imported and registered multiple times, often due to circular imports or duplicate imports.
解决方案
-
90% 成功率
Ensure each .proto file is imported only once in the dependency graph; use go module to manage dependencies.
-
85% 成功率
Use protoc with --go_opt=paths=source_relative to avoid duplicate registration.
无效尝试
常见但无效的做法:
- 70% 失败
- 60% 失败