initial import

This commit is contained in:
SourceFellows
2020-08-21 06:26:40 +02:00
commit e223458dd4
423 changed files with 9871 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package main
import (
"fmt"
"math/rand"
"time"
)
var c chan string
func printOut() {
for i := 1; i < 10; i++ {
c <- fmt.Sprintf("Print %v", i)
time.Sleep(time.Duration(rand.Intn(500)) * time.Millisecond)
}
close(c)
}
func main() {
c = make(chan string)
go printOut()
for {
t, open := <-c
if open {
fmt.Println(t)
} else {
break
}
}
}