Answer the question
In order to leave comments, you need to log in
How to do foreach in golang?
My code is now:
func main() {
x := make(map[string]int)
x["kid"] = 10
x["man"] = 9
x["woman"] = 8
fmt.Println(x)
}
Answer the question
In order to leave comments, you need to log in
for i, v := range x {
fmt.Println(i, v)
}
i -- index _
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question