Understanding the Go Runtime: The Reflect Package

In the previous article we watched the runtime rebuild an entire stack trace out of metadata the compiler and linker had frozen into the binary at build time. I told you at the end that reflect works on exactly the same trick — metadata baked into the binary, only pointed at your data instead of your call stack. Today we’re going to cash that promise in.

Let’s start with a program that, the first time you see it, feels like it shouldn’t be possible:

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论