title: Why does fmt.Println in Go print the verb %s literal instead of the value?
body: <p>Consider,</p>
  
  <pre><code>package main
  import "fmt"
  
  func main() {
    name := "johnny"
    fmt.Println("Hello world %s\n", name)
  }
  </code></pre>
  
  <p>prints out,</p>
  
  <p>Hello world <strong>%s</strong>
   johnny</p>
  
  <hr>
  
  <p>Why do I get the %s instead of this,</p>
  
  <pre><code>package main
  import "fmt"
  
  func main() {
    name := "johnny"
    fmt.Printf("Hello world %s\n", name)
  }
  </code></pre>
  
  <p>which prints Hello world johnny?</p>
  
  <p>I have tried to figure out the answer from the <a href="https://golang.org/pkg/fmt/#Println" rel="nofollow">documentation</a>,</p>
  
  <blockquote>
    <p>If the format (which is implicitly %v for Println etc.) is valid for a
    string (%s %q %v %x %X), the following two rules apply:</p>
    
    <ol start="4">
    <li><p>If an operand implements the error interface, the Error method will be invoked to convert the object to a string, which will then be
    formatted as required by the verb (if any).</p></li>
    <li><p>If an operand implements method String() string, that method will be invoked to convert the object to a string, which will then be
    formatted as required by the verb (if any).</p></li>
    </ol>
  </blockquote>
  
  <p>But I'm having trouble understanding if this is affecting my program.</p>