【发布时间】:2021-11-19 10:17:20
【问题描述】:
当我第二次加载插件时遇到这个奇怪的问题,它抛出错误
plugin.Open("/path/to/plugin"): plugin already loaded
来自documentation,它说
Open opens a Go plugin. If a path has already been opened, then the existing *Plugin is returned.
It is safe for concurrent use by multiple goroutines.
但是,当我尝试多次加载插件时,情况并非如此。 Issue 提到了这一点,但建议的修复不适用于较新的版本。
可以在here找到一个最小的可重现示例
任何帮助表示赞赏:) 提前致谢
【问题讨论】: