Is there anyway I can loop over the inner maps and not just the main map?
./prog.go:49:31: cannot range over days (variable of type interface{})
My code in case nobody want to use play space:
package main
import (
"fmt"
)
func main() {
package main
import (
"fmt"
)
func main() {
var mapData = map[string]interface{}{
"Monday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
"Tuesday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
"Wednesday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
"Thursday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
"Friday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
"Saturday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
"Sunday": map[string]interface{}{
"First": "34520 16th Ave S, Federal Way, WA+98003",
"Second": "",
"Third": "Lynwood",
},
}
for _, days := range mapData {
fmt.Println("day", days)
for _, appointment := range days {
fmt.Println("appointment", appointment)
}
}
}