<p>Hi all!
Currently i'm trying to use 3rd part lib as a plugin in my project and faced difficulties with exporting symbols. It seems that go exports symbols only from the main package, but not from others. </p>
<pre><code>src/
package/
package.go <- has sybol func Foo()
main.go <- has import _ "./package"
</code></pre>
<p>Is there a way around of this? </p>
<hr/>**评论:**<br/><br/>Femaref: <pre><p>that is by design. Imports are only for the current file. If you want to use <code>Foo</code> elsewhere, you need to import the package it is defined in.</p></pre>x_Fresh_x: <pre><p>After some research, i decided to wrap dlopen and use that to export fields/funcs i need. The topic may be considered as closed. </p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传