<p>I like Go due to its simplicity and explicit, which making me wonder if there any magic (some sort of advance trick) similar to Java's reflection or bytecode manipulation.</p>
<hr/>**评论:**<br/><br/>driusan: <pre><p>I'm not sure what you're looking for exactly, but Go has its own reflect package:</p>
<p><a href="https://golang.org/pkg/reflect/" rel="nofollow">https://golang.org/pkg/reflect/</a></p></pre>drabiter: <pre><p>Didn't know it exists before, seems pretty much powerful.</p></pre>HectorJ: <pre><p>Also see <a href="https://golang.org/pkg/unsafe/#Pointer" rel="nofollow">https://golang.org/pkg/unsafe/#Pointer</a></p></pre>letsencrypt: <pre><p>You can always use <a href="https://golang.org/pkg/unsafe/" rel="nofollow">unsafe</a> to do all the ✨magic✨ you want.<br/>
EDIT: Or <a href="https://golang.org/cmd/cgo/" rel="nofollow">cgo</a> but maybe I'm misunderstanding your intentions.</p></pre>Astrus: <pre><p>I like doing magic in Go: <a href="https://github.com/lukechampine/freeze" rel="nofollow">https://github.com/lukechampine/freeze</a></p></pre>drabiter: <pre><p>this one is interesting, thanks</p></pre>k_u_r_o_k_u_s_e: <pre><p>Go has extensive reflection capabilities, it's difficult to use but it's there.</p>
<p>There is no bytecode manipulation, there are unsafe pointers but I wouldn't use them.</p></pre>drvd: <pre><p>There is no magic in Touring complete languages.</p></pre>ChristophBerger: <pre><p>Magic is in the eye of the beholder.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传