title: golang code insert/substitute
body: <p>I like not to allow the code to repeat. But I have a situation, when I must repeat it in every function I want to measure execution time, and I can do nothing to it.
  For example, a function:</p>
  
  <pre><code>func someFunc() {
      start_time := time.Now()
      defer fmt.Println("Execution time: %v", time.Now().Sub(start_time))
      &lt;... doing some bussiness ...&gt;
  }
  </code></pre>
  
  <p>Now I must repeat this two first strokes in every function (and in original they are more complicated because of calling a function name). So I cannot make a function which measures time, because i must use defer inside of it. I cannot make a function even for second stroke, cause in original it calls a function name in Println and that's why the resulting name will not be of needed function.
  Is there any way to insert this code by some label or a template, for example, like this:</p>
  
  <pre><code>func someFunc() {
  //go-insert measuretime.tmpl
      &lt;... doing some bussiness ...&gt;
  }
  </code></pre>
  
  <p>And measuretime.tmpl is:</p>
  
  <pre><code>start_time := time.Now()
  defer fmt.Println("Execution time: %v", time.Now().Sub(start_time))
  </code></pre>