I\'m doing some tests with goroutines just to learn how they work, however it seems they are not running at all. I\'ve done a very simple test:
package main
program execution does not wait for the invoked function to complete Go statements
program execution does not wait for the invoked function to complete
Go statements
Wait a while. For example,
package main import ( "fmt" "time" ) func test() { fmt.Println("test") } func main() { go test() time.Sleep(10 * time.Second) }
Output:
test