The Below code is not working as expected.
package main
import "fmt"
func main() {
questions := make(map[int]interface{})
questions[1] = map[interface{}]string{
"q1": "This is Question - 1?",
"op1": "This is Option - 1",
"op2": "This is Option - 2",
true: "This is Option - 1",
}
// This give map[interface {}]string
fmt.Printf("%T
", questions[1])
// This not working
for key, val := range questions[1] {
printf("%v : %v", key, val)
}
}
The for loop that is ranging over the map is not working.
The Go compiler giving error "Cannot range over questions[1] (type interface {})"