Created
October 16, 2014 23:04
-
-
Save whyrusleeping/90d0fc992c77b988bbe5 to your computer and use it in GitHub Desktop.
i wish
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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