<p>I'm a backend engineer from PHP to Go. Back to those days, when I have to compile extensions to <code>.so</code> files and put them in the sepcified path and enable it in the PHP configuration file .. that was totally a nightmare for me.</p>
<p>And recently that there're some news about that you can use Plugins in Go 1.8 (you can even try it now with Go 1.8-beta), I'm affraid something like that happend again.</p>
<p>For example if there's a package that depends on a plugin, you would have to download or compile the plugin first, and then put it in somewhere, then you can finally use the package, I think this is a little bit complex for me. (though plugins are useful)</p>
<p>What's your thoughts? Am I thinking with it in the wrong direction?</p>
<hr/>**评论:**<br/><br/>tscs37: <pre><p>The difference is that PHP runs on top of a binary that uses these <code>.so</code> files while Go is largely self-contained.</p>
<p>When a PHP package requires some extension, you need to install it.</p>
<p>Go is (IMO) not meant to operate in that way, if you require an extension it should not be a plugin.</p>
<p>I'm more excited to see extensions in places like Caddyserver where it means making plugins of optional extensions. If one is missing the server works as before granted you're not using the configuration keys of the plugin.</p>
<p>I also think that the Go Ecosystem should push a configuration free plugin system. Plugins should be enabled if present not if configured and a blacklist may be used if necessary.</p></pre>headzoo: <pre><blockquote>
<p>Go is (IMO) not meant to operate in that way, if you require an extension it should not be a plugin.</p>
</blockquote>
<p>That's the way I see the plugin system being used as well. It's all about making the application extensible. For instance adding new credit card processors to an ecommerce app, or different types of file systems for image storage like local, S3, or Dropbox.</p></pre>tscs37: <pre><p>Exactly, this is what I plan to use it for; extensible storage and frontend options.</p>
<p>I think a second, differently oriented option is to also have security modules.</p>
<p>This would be interesting for Caddy too, as a special plugin could be used to patch security vulnerabilities in the server crypto, which is the main complaint (some but not me) people have with Go's static compilation.</p></pre>headzoo: <pre><p>That sounds like a great use as well. Configurable/extensible middleware too.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传