tips

golang reflection tips

Because I'm the kind of person who likes genericity, I often find myself using features of languages that are flagged as “only use it if you know what you're doing”. Golang reflection is one of those features, powerful yet a bit confusing. Reflection, as explained in The Laws of Reflection is the ability of a program to examine its own structure, particularly through types; it's a form of metaprogramming In short, you can introspect variables at run-time, making your program exceptionally dynamic.