知识卡片
动态加载仍有构建兼容成本
原生Go插件不是跨工具链的稳定通用二进制接口。原书针对Go1.14.6说明平台和构建版本限制,宿主与插件共享依赖也要匹配;同路径加载会复用插件,不能按可随意卸载重载的模型设计。扩展能力应同发布与构建约束一起选择,具体支持范围需按目标版本核验。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Loose Coupling · 查看原书依据
The version of Go used to build a plugin must match the program that’s using it exactly. Plugins built with Go 1.14.5 won’t work with Go 1.14.6. Similarly, the versions of any packages used by both the plugin and program must also match exactly. Finally, building plugins forces CGO_ENABLED, making cross-compiling more complicated. These conditions
参考来源
- 位置:《Cloud Native Go》第08章《Loose Coupling》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch08.xhtml)
- 结论依据:原生Go插件不是跨工具链的稳定通用二进制接口。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。
- 原始内容:The version of Go used to build a plugin must match the program that’s using it exactly. Plugins built with Go 1.14.5 won’t work with Go 1.14.6. Similarly, the versions of any packages used by both the plugin and program must also match exactly. Finally, building plugins forces CGO_ENABLED, making cross-compiling more complicated. These conditions