Scanning artists and albums too

This commit is contained in:
Deluan
2016-02-28 13:50:05 -05:00
parent bccfeec2d3
commit 14e52576a7
11 changed files with 209 additions and 51 deletions
+4 -5
View File
@@ -121,17 +121,16 @@ func ToMap(rec interface{}) (map[string]interface{}, error) {
return m, err
}
func ToStruct(m map[string]interface{}) (interface{}, error) {
func ToStruct(m map[string]interface{}, rec interface{}) error {
// Convert to JSON...
b, err := json.Marshal(m);
if err != nil {
return nil, err
return err
}
// ... then convert to map
var rec interface{}
// ... then convert to struct
err = json.Unmarshal(b, &rec)
return rec, err
return err
}
func Flatten(input interface{}) (map[string]interface{}, error) {