Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created August 2, 2020 06:32
Show Gist options
  • Select an option

  • Save luandevpro/5b61aa8f907b1e53d93b4b6a7a4bdb4a to your computer and use it in GitHub Desktop.

Select an option

Save luandevpro/5b61aa8f907b1e53d93b4b6a7a4bdb4a to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func WellCome1(s string) {
for i := 0; i < 5; i++ {
fmt.Println(s, ":",i)
}
}
func WellCome2(s string) {
for i := 0; i < 5; i++ {
fmt.Println(s, ":",i)
}
}
func main() {
go WellCome1("wellcome1")
go WellCome2("wellcome2")
time.Sleep(200*time.Millisecond)
fmt.Println("hello main ")
}
wellcome1 : 0
wellcome1 : 1
wellcome2 : 0
wellcome1 : 2
wellcome1 : 3
wellcome1 : 4
wellcome2 : 1
wellcome2 : 2
wellcome2 : 3
wellcome2 : 4
hello main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment