golang map string code example
Example 1: go add to map
m := make(map[string]int)
m["numberOne"] = 1
m["numberTwo"] = 2
Example 2: dictionary golang
package main
import (
"fmt"
)
func main() {
dict := map[interface{}]interface{} {
1: "hello",
"hey": 2,
}
fmt.Println(dict) // map[1:hello hey:2]
}
Example 3: map string interface golang
{
"name":"John",
"age":29,
"hobbies":[
"martial arts",
"breakfast foods",
"piano"
]
}