Skip to content

Commit 9b4cb79

Browse files
authored
Merge pull request astaxie#1072 from tilics/master
update socket编程部分 readAll -> read
2 parents f939c7e + ec79d0d commit 9b4cb79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

zh/08.1.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ func main() {
149149
checkError(err)
150150
_, err = conn.Write([]byte("HEAD / HTTP/1.0\r\n\r\n"))
151151
checkError(err)
152-
result, err := ioutil.ReadAll(conn)
152+
// result, err := ioutil.ReadAll(conn)
153+
result := make([]byte, 256)
154+
_, err = conn.Read(result)
153155
checkError(err)
154156
fmt.Println(string(result))
155157
os.Exit(0)

0 commit comments

Comments
 (0)