test codes below:
func main() {
lans := [5]string{"java", "python", "erlang", "cpp", "go"}
fin := make(chan bool)
for _, l := range(lans) {
go func() {
fmt.Println(l)
}()
}
<- fin
}
I think the output will be: java, python, erlang, cpp, go; but the output is: go go go go go; what's wrong here?