mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:33:04 +08:00
@@ -281,7 +281,7 @@ ch := make(chan int)
|
|||||||
go func(){
|
go func(){
|
||||||
// doSomething
|
// doSomething
|
||||||
ch <- 1 // Send a signal; value does not matter
|
ch <- 1 // Send a signal; value does not matter
|
||||||
}
|
}()
|
||||||
doSomethingElseForAWhile()
|
doSomethingElseForAWhile()
|
||||||
<- ch // Wait for goroutine to finish; discard sent value.
|
<- ch // Wait for goroutine to finish; discard sent value.
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user