1
0
mirror of https://github.com/golang/go synced 2024-11-26 04:47:57 -07:00

doc/go1.20: fix http.ResponseController example

Fixes #57162

Change-Id: I190810d702e503822265b12c56db69ec1093233c
GitHub-Last-Rev: e8b259d4b3
GitHub-Pull-Request: golang/go#57385
Reviewed-on: https://go-review.googlesource.com/c/go/+/458275
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Heschi Kreinick <heschi@google.com>
This commit is contained in:
Alexander Yastrebov 2022-12-17 12:47:53 +00:00 committed by Gopher Robot
parent cdc73f0679
commit d03231d9ce

View File

@ -458,7 +458,7 @@ Do not send CLs removing the interior tags from such phrases.
<pre>
func RequestHandler(w ResponseWriter, r *Request) {
rc := http.NewResponseController(w)
rc.SetWriteDeadline(0) // disable Server.WriteTimeout when sending a large response
rc.SetWriteDeadline(time.Time{}) // disable Server.WriteTimeout when sending a large response
io.Copy(w, bigData)
}
</pre>