Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Arbitrary := struct {
- field1 string
- field2 string
- }{"a", "b"}
- fmap := make(map[string]func(string) string)
- fmap["fone"] = func(s string) { fmt.Printf("function fone: %s", s) }
- fmap["ftwo"] = func(s string) { fmt.Printf("function ftwo: %s", s) }
- // probably ok, as simple examples go, to this point where reflection needs to be used
- Arbitrary.fone = fmap["fone"]
- Arbitrary.fone("hello")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement