title: Why %v is printing unexpected value for nested struct?
body: <p>When printing a struct with nested struct which has a String() implemented, the <code>%v</code> format prints an 'unexpected' value per our understanding. </p>
  
  <p>Below is the code snippet.</p>
  
  <pre><code>package main
  
  import (
    "fmt"
  )
  
  type Inner struct {
  }
  
  type A struct {
      Inner
      FieldA string
  }
  
  func (i Inner) String() string {
      return "anything"
  }
  
  func main() {
      myA := A{FieldA: "A"}
      fmt.Printf("%v", myA)
  }
  </code></pre>
  
  <p>We expect the output to be</p>
  
  <blockquote>
    <p>{anything A}</p>
  </blockquote>
  
  <p>But the actual result is</p>
  
  <blockquote>
    <p>anything</p>
  </blockquote>
  
  <p>Why this result? It seems <code>FieldA</code> is ignored? To make it more confusing, if we have two nested structs where both of them have String() implemented, the output is expected.</p>
  
  <pre><code>package main
  
  import (
    "fmt"
  )
  
  type Inner struct {
  }
  
  type InnerAgain struct {
  }
  
  type A struct {
      Inner
      InnerAgain
      FieldA string
  }
  
  func (i Inner) String() string {
      return "anything"
  }
  
  func (i InnerAgain) String() string {
      return "nothing"
  }
  
  func main() {
      myA := A{FieldA: "A"}
      fmt.Printf("%v", myA)
  }
  </code></pre>
  
  <p>The output is</p>
  
  <blockquote>
    <p>{anything nothing A}</p>
  </blockquote>
  
  <p>...</p>