Skip to content

Commit

Permalink
Merge pull request hantmac#148 from whoisix/patch-1
Browse files Browse the repository at this point in the history
修改错误代码
  • Loading branch information
hantmac committed Apr 2, 2020
2 parents 0df167b + 32688d3 commit 346150f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eBook/chapter10/10.7.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func connect(c context.Context) error {
fmt.Println("Error select:", err)
return err
}
fmt.Println("Server Response: %s\n", realHTTPData)
fmt.Printf("Server Response: %s\n", realHTTPData)
}
return nil
}
Expand All @@ -118,7 +118,7 @@ func main() {

fmt.Println("Delay:", delay)
c := context.Background()
c, cancel := contedxt.WithTimeout(c, time.Duration(delay)*time.Second)
c, cancel := context.WithTimeout(c, time.Duration(delay)*time.Second)
defer cancel()

fmt.Printf("Connecting to %s \n", myUrl)
Expand Down Expand Up @@ -199,4 +199,4 @@ Delay: 13

![""](https://github.com/hantmac/Mastering_Go_ZH_CN/tree/master/images/chapter10/10.7.1.jpg)

这个输出显示只有第三个命令确实从 HTTP 服务器获得了响应——第一和第二个命令都超时了!
这个输出显示只有第三个命令确实从 HTTP 服务器获得了响应——第一和第二个命令都超时了!

0 comments on commit 346150f

Please sign in to comment.