Zippi
33
Q:

create map golang

m := make(map[string]int)
m["numberOne"] = 1
m["numberTwo"] = 2
3
//map in go is a built in type implementaiton of has table
//create a empty map
myMap := make(map[string]string)
//insert key-value pair in map
myMap["key"] = "value"
//read from map
value, ok := myMap["key"]
//delete from map
delete(myMap, "key")
0
Search Results
Featured snippet from the web
In Go language, a map is a powerful, ingenious, and a versatile data structure. Golang Maps is a collection of unordered pairs of key-value. It is widely used because it provides fast lookups and values that can retrieve, update or delete with the help of keys. It is a reference to a hash table.
0

Tags

New to Communities?

Join the community