I need to parse an interface read from a JSON object which is deeply nested. I use the following recursive function to get most of the array.
func arrayReturn(m map[string]interface{}) []interface{} {
for _, v:= range m {
if v.(type) == map[string]interface{} {
return arrayReturn(v.(map[string]interface{}))
}
if v.(type) == string {
return v.([]interface{})
}
}
}
Which gives this error for the return line:
syntax error: unexpected return, expecting expression
What does "expecting expression" mean?