I have been trying to add to a map using a for loop in golang but I haven't been able to do so. Could anybody give a simple example of how it could be done?
Thank you!
(Moving from a comment to an answer.)
myMap := make(map[int]string)
for i := 0; i < 3; i++ {
myMap[i] = fmt.Sprintf("iteration %d;", i)
}