Let's say I want to set a for loop running but don't want to block the execution, obviously I can put the for loop in a function f
and call go f
and continue with my life,
but I was curious if there is a way to call go for
directly, something like:
fmt.Println("We are doing something")
//line below is my question
go for i := 1; i < 10; i ++ {
fmt.Println("stuff running in background")
}
// life goes on
fmt.Println("c'est la vie")