Created
December 22, 2015 10:55
-
-
Save tbillington/98f0c46db20ddb61fe3e 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
type part struct { | |
Type string `json:type` | |
Args map[string]string `json:args` | |
Properties map[string]string `json:properties` | |
} | |
type binFunc func(interface{}) | |
stuff := map[string]binFunc{} | |
for _, p := range jsonParts.Parts { | |
fmt.Println(p) | |
stuff[p.Type] = func(data interface{}) { | |
fmt.Println(p.Args) | |
fmt.Println(p.Properties) | |
} | |
} | |
for k, t := range stuff { | |
fmt.Println(k) | |
t(nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment