title: Why does method signature have to perfectly match interface method
body: <p>I began to learn Go and have trouble understanding the following:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  type I interface {
      foo(interface {})
  }
  
  type S struct {}
  
  func (s S) foo(i int) {
      fmt.Println(i)
  }
  
  func main() {
      var i I = S{}
      i.foo(2)
  }
  </code></pre>
  
  <p>This fails with:</p>
  
  <pre><code>cannot use S literal (type S) as type I in assignment:
          S does not implement I (wrong type for foo method)
                  have foo(int)
                  want foo(interface {})
  </code></pre>
  
  <p>I don't understand why Go doesn't accept the <code>foo(int)</code> signature given the fact that <code>int</code> implements <code>interface {}</code>. Can anyone help with an explanation?</p>