title: Golang method receiver
body: <p>According <a href="https://stackoverflow.com/questions/15096329/golang-pointers">this question</a>, golang will generate both <code>type-receiver method</code> and <code>point-receiver method</code>, which means the code below will work correctly and the value will change unexpectedly.</p>
  
  <pre><code>func (test *Test) modify() {
      test.a++
  }
  
  func main() {
      test := Test{10}
      fmt.Println(test)
      test.modify()
      fmt.Println(test)
  }
  </code></pre>
  
  <p>I think it's acceptable to me. But when this mixes with interface, thing goes wrong. </p>
  
  <pre><code>type Modifiable interface {
      modify()
  }
  
  type Test struct {
      a int
  }
  
  func (test *Test) modify() {
      test.a++
  }
  
  func main() {
      test := Test{10}
      fmt.Println(test)
      test.modify()
      fmt.Println(test)
  
      var a Modifiable
  
      a = test
  }
  </code></pre>
  
  <p>it said:</p>
  
  <pre><code>Test does not implement Modifiable (modify method has pointer receiver)
  </code></pre>
  
  <p>Why will this happen ?</p>
  
  <p>And how golang actually handle method call ?</p>