Here I have a variable which show me the result in the nested mapped data but I want to access the nested mapped data values. How I will try to get the nested mapped data in the below program:-
package main
import (
"fmt"
)
func main() {
var five []int
var ten []int
mp1 := make(map[string]interface{})
for i := 0; i < 0; i++ {
if i > 5 {
five = append(five, i)
}
ten = append(ten, i)
fmt.Println(i)
}
mp1["not_completed"] = five
mp1["completed"] = ten
mp3 := make(map[string]interface{})
mp3["new_data"] = mp1
fmt.Println(mp3)
fmt.Println(mp3["new_data"])
}
This is the link of the go playground I want to access the values of the data mapped in "completed" and "not_completed" . Will anyone give some help to me to solve this.
for _, v := range mp3 {
for _,v1:= range v.(map[string]interface{}){
fmt.Println(v1)
}
}