Is there an easy/simple means of converting a slice into a map in Golang? Like converting an array into hash in perl is easy to do with simple assignment like %hash =
elements := []string{"abc", "def", "fgi", "adi"}
elementMap := make(map[int]string)
for i, data := range elements {
elementMap[i] = data
}
fmt.Println(elementMap ) // map[0:abc 1:def 2:fgi 3:adi]