title: How to get the variable name as in the source code (using reflect)
body: <p>I'm trying to build an easy to use templating system. Basically I just want to create a slice with different variables ( strings ) and then loop through the slice and replace the markup <code>{{}}</code> with the actual values. So if the variable '<code>name</code>' is <code>onevar</code> it will look in the template for <code>{{onevar}}</code> and replace that with the actual value of the variable . </p>
  
  <p>Question: how do I get the variable name? Basically  what's in the source code. Is it possible ? I've tried something with reflect but seems I couldn't get it right. See belowg</p>
  
  <pre><code>onevar := "something"
  other := "something else"
  
  var msg string
      sa := []string{onevar, other}
      for _, v := range sa {
          vName := reflect.TypeOf(v).Name()
          vName = fmt.Sprintf("{{%s}}", vName)
          msg = strings.Replace(msg, vName, v, -1)
      }
  </code></pre>