Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Created October 16, 2014 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whyrusleeping/90d0fc992c77b988bbe5 to your computer and use it in GitHub Desktop.
Save whyrusleeping/90d0fc992c77b988bbe5 to your computer and use it in GitHub Desktop.
i wish
package main
import (
"fmt"
)
type Fun func(int) int
type Thing struct {
A int
Fun
}
func main() {
t := new(Thing)
t.Fun = func(i int) int {
return i * 10
}
fmt.Println(t(5))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment