package main
import (
"fmt"
"time"
)
func main() {
registerChan:=make(chan string)
go func(){
registerChan<-"hi"
}()
go func(){
registerChan<-"hello"
}()
schedule(registerChan)
}
func schedule(registerChan chan string){
workers := []string{}
go func(wkrs *[]string){
for{
wkr := <-registerChan
*wkrs = append(*wkrs,wkr)
}
}(&workers)
time.Sleep(4)
fmt.Println(workers,len(workers))
}