title: How to replace string in Go template?
body: <p>I use <code>"text/template"</code> module.</p>
  
  <p>I have struct like this to parse XML from Blogger</p>
  
  <pre><code>type Media struct {
      ThumbnailUrl string `xml:"url,attr"`
  }
  
  
  type Entry struct {
      ID string `xml:"id"`
      Published Date `xml:"published"`
      Updated Date `xml:"updated"`
      Draft Draft `xml:"control&gt;draft"`
      Title string `xml:"title"`
      Content string `xml:"content"`
      Tags Tags `xml:"category"`
      Author Author `xml:"author"`
      Media Media `xml:"thumbnail"`
      Extra string
  }
  </code></pre>
  
  <p>Then I create Go Template like this</p>
  
  <pre><code>[image]
      src = "{{ replace .Media.ThumbnailUrl 's72-c' 's1600' }}"
      link = ""
      thumblink = "{{ .Media.ThumbnailUrl }}"
      alt = ""
      title = ""
      author = ""
      license = ""
      licenseLink = ""
  </code></pre>
  
  <p>The replace function not defined. I want to replace URL from <code>{{ .Media.ThumbnailUrl }}</code></p>
  
  <p>For example:</p>
  
  <p>from this URL</p>
  
  <p><code>https://2.bp.blogspot.com/-DEeRanrBa6s/WGWGwA2qW5I/AAAAAAAADg4/feGUc-g9rXc9B7hXpKr0ecG9UOMXU3_VQCK4B/s72-c/pemrograman%2Bjavascript%2B-%2Bpetanikode.png</code></p>
  
  <p>To this URL</p>
  
  <p><code>https://2.bp.blogspot.com/-DEeRanrBa6s/WGWGwA2qW5I/AAAAAAAADg4/feGUc-g9rXc9B7hXpKr0ecG9UOMXU3_VQCK4B/s1600/pemrograman%2Bjavascript%2B-%2Bpetanikode.png</code></p>