mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 04:48:29 +08:00
Fix 14.5, 14.6, 15.1 (#283)
* Update 07.3.md * Update 07.3.md * Update 07.6.md * fix few problems * Update 10.6 and 10.8 * Update 11.6 and 11.7 * fix some problems before Chap13 * add a dot * Update 13.9 * little improve * Thoughts about time.After * Thoughts about time.After * Fix 14.6,15.1
This commit is contained in:
@@ -27,11 +27,11 @@ func main() {
|
||||
func doServerStuff(conn net.Conn) {
|
||||
for {
|
||||
buf := make([]byte, 512)
|
||||
_, err := conn.Read(buf)
|
||||
len, err := conn.Read(buf)
|
||||
if err != nil {
|
||||
fmt.Println("Error reading", err.Error())
|
||||
return //终止程序
|
||||
}
|
||||
fmt.Printf("Received data: %v", string(buf))
|
||||
fmt.Printf("Received data: %v", string(buf[:len]))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user