title: Format a Go string without printing?
body: <p>Is there a simple way to format a string in Go without printing the string?</p>
  
  <p>I can do:</p>
  
  <pre><code>bar := "bar"
  fmt.Printf("foo: %s", bar)
  </code></pre>
  
  <p>But I want the formatted string returned rather than printed so I can manipulate it further.</p>
  
  <p>I could also do something like:</p>
  
  <pre><code>s := "foo: " + bar
  </code></pre>
  
  <p>But this becomes difficult to read when the format string is complex, and cumbersome when one or many of the parts aren't strings and have to be converted first, like</p>
  
  <pre><code>i := 25
  s := "foo: " + strconv.Itoa(i)
  </code></pre>
  
  <p>Is there a simpler way to do this?</p>