title: Why using anonymous field in struct enables the type to satisfy interface when there's no methods written?
body: <p>For a type to satisfy an interface, the type needs to implement the methods defined in the interface.</p>
  <p>However, in the code snippet below, <code>myStruct</code> does not have any methods written, but by using <code>someInterface</code> as anonymous field, it satisfies <code>someInterface</code>.</p>
  <p>Can someone help explain why is it? Thank you.</p>
  <pre><code>package main
  
  import &quot;fmt&quot;
  
  type someInterface interface {
      method1(int) string
      method2(string) string
  }
  
  type myStruct struct {
      someInterface
      body int
  }
  
  func main() {
      var foo someInterface
      bar := myStruct{}
  
      foo = bar // why no compile error??
  
      fmt.Println(foo)
  }
  </code></pre>