title: Pass method argument to function
body: <p>I'm curious if this is possible in Go. I have a type with multiple methods. Is it possible to have a function which takes a method argument and then call it for the type?</p>
  
  <p>Here is a small example of what I would want:</p>
  
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import (
      "fmt"
  )
  
  type Foo int
  
  func (f Foo) A() {
      fmt.Println("A")
  }
  func (f Foo) B() {
      fmt.Println("B")
  }
  func (f Foo) C() {
      fmt.Println("C")
  }
  
  func main() {
      var f Foo
      bar := func(foo func()) {
          f.foo()
      }
      bar(A)
      bar(B)
      bar(C)
  }
  </code></pre>
  
  <p>Go thinks type <code>Foo</code> has a method called <code>foo()</code>, rather than replacing it with the passed in method name.</p>