title: converting a method to a function with a pointer to the struct in Golang
body: <p>I read some strange codes which convert a method to a function whose first argument is a pointer to this method's struct.</p>
  
  <p>I write an example to demonstrate it:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  type fooS struct{}
  
  func (s *fooS) fooF(fooArg interface{}) {
      fmt.Println("fooF: ", fooArg)
  }
  
  type wowS struct {
      callback func(s *fooS, fooArg interface{})
  }
  
  func main() {
      wow := new(wowS)
      wow.callback = (*fooS).fooF // strange
      wow.callback(nil, 123)
  }
  </code></pre>
  
  <p><a href="https://play.golang.org/p/NVsz_JgE2K" rel="nofollow">Golang Playground Link</a></p>
  
  <p>The example's syntax is strange but has no error.</p>
  
  <p>Can any one tell me how these codes work or give me an official document about them?</p>
  
  <p>Thanks:)</p>