<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>
