golang ã®ç¹å¾´ã¨è¨ãã° goroutine 㨠channel ã§ããããã®ä½¿ãã©ããã«æ©ã人ãããããæ§ã§ãã goroutine ã¯éåæã«å®è¡ãããå¦çãchannel ã¯ãã® groutine ã¨éä¿¡ããçºã®ä»çµã¿ã¨èããã¨åãããããã§ãã package main import ( "fmt" "time" ) func main() { task := make(chan string) taskquit := make(chan bool) workerquit := make(chan bool) go func() { loop: for { select { case <-taskquit: workerquit <- true break loop case job := <-task: fmt.Println(job) } } }() go func() {
{{#tags}}- {{label}}
{{/tags}}