mirror of
https://github.com/gopl-zh/gopl-zh.github.com.git
synced 2025-08-06 15:32:19 +00:00
ch8: fix code format
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
|
||||
在8.3節的客戶端程序,它在主goroutine中(譯註:就是執行main函數的goroutine)將標準輸入複製到server,因此當客戶端程序關閉標準輸入時,後台goroutine可能依然在工作。我們需要讓主goroutine等待後台goroutine完成工作後再退出,我們使用了一個channel來同步兩個goroutine:
|
||||
|
||||
<u><i>gopl.io/ch8/netcat3</i></u>
|
||||
```Go
|
||||
gopl.io/ch8/netcat3
|
||||
func main() {
|
||||
conn, err := net.Dial("tcp", "localhost:8000")
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user