<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tips on iMil.net</title>
    <link>http://imil.net/blog/tags/tips/</link>
    <description>Recent content in Tips on iMil.net</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 01 Mar 2019 17:16:48 +0000</lastBuildDate>
    <atom:link href="http://imil.net/blog/tags/tips/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>golang reflection tips</title>
      <link>http://imil.net/blog/posts/2019/golang-reflection-tips/</link>
      <pubDate>Fri, 01 Mar 2019 17:16:48 +0000</pubDate>
      <guid>http://imil.net/blog/posts/2019/golang-reflection-tips/</guid>
      <description>&lt;p&gt;Because I&amp;rsquo;m the kind of person who likes genericity, I often find myself using features of languages that are flagged as &lt;em&gt;&amp;ldquo;only use it if you know what you&amp;rsquo;re doing&amp;rdquo;&lt;/em&gt;. &lt;em&gt;Golang reflection&lt;/em&gt; is one of those features, powerful yet a bit confusing.&lt;/p&gt;&#xA;&lt;p&gt;Reflection, as explained in &lt;a href=&#34;https://golang.org/pkg/reflect/&#34;&gt;The Laws of Reflection&lt;/a&gt; is &lt;em&gt;the ability of a program to examine its own structure, particularly through types; it&amp;rsquo;s a form of metaprogramming&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;In short, you can introspect variables at run-time, making your program exceptionally dynamic. How can this serve any purpose? well imagine for example creating function names dynamically by another function parameter. Pretty cool uh?&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
