Skip to content

Commit b81e4d8

Browse files
committed
Channels and go routines
1 parent 386796d commit b81e4d8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

go/goRoutines/goRoutines.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package main
2+
3+
import "fmt"
4+
import "time"
5+
func main(){
6+
go fmt.Printf("Printed in the background")
7+
i:= 1
8+
go fmt.Printf("currently,i is %d\n", i)
9+
go func(){
10+
fmt.Printf("i: %d\n",i)
11+
}()
12+
i++
13+
time.Sleep(10000000000)
14+
}

0 commit comments

Comments
 (0)