I found the code
newMap := map[string]interface{}{
"string1" : 1,
"string2" : "hello",
"string3" : map[string]string{
"hello" : "hello there"
}
}
My guess is that If we use interface for map as the value type, then we can insert any type to value, is it correct?
Actually, it has nothing specific with map. But response to your question is yes
. You can insert anything you want inside.
Definition for empty interface from "A Tour of Go"
An empty interface may hold values of any type. (Every type implements at least zero methods.)
Check example on A Tour of Go