Created
May 21, 2015 19:10
-
-
Save djmitche/7887a414c2c5f9a21fb0 to your computer and use it in GitHub Desktop.
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 | |
| func call_a_thing(f func() interface{}) { | |
| } | |
| type Structure struct { | |
| a int | |
| } | |
| func thing1() Structure { | |
| return Structure{1} | |
| } | |
| func main() { | |
| call_a_thing((func () interface{})(thing1)) | |
| } |
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
| ./foo.go:15: cannot convert thing1 (type func() Structure) to type func() interface {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment