Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: docs for TimeoutHandler are incorrect about supporting Flusher interface. #35161

Closed
pokutuna opened this issue Oct 25, 2019 · 1 comment

Comments

@pokutuna
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.13.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes (but it's a document bug)

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/pokutuna/Library/Caches/go-build"
GOENV="/Users/pokutuna/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/pokutuna/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.3/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/t1/0tt54gx57qv22cgmqy4yjwkm0000gn/T/go-build717603803=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

This says TimeoutHandler supports Flusher interface, but it doesn't.

https://github.com/golang/go/blob/go1.13.3/src/net/http/server.go#L3180L3181

https://play.golang.org/p/fd9mwwk3csz

The TimeoutHandler.Flush was reverted in a month on #34439.
I think the comment on TimeoutHandler needs to be updated.

Timeline about TimeoutHandler.Flush

  • 2889332 net/http: make TimeoutHandler's ResponseWriter implement Pusher
  • f3e3b71 net/http: change TimeoutHandler's docs to match its new interfaces
    • this added this document that says TimeoutHandler supports Flusher.
  • 4faf8a8 net/http, doc/go1.13.html: revert TimeoutHandler.Flush
    • this had to update its comment on TimeoutHandler implementation.

What did you expect to see?

(this issue mentions document)

What did you see instead?

(this issue mentions document)

pokutuna added a commit to pokutuna/go that referenced this issue Oct 25, 2019
… interface.

The TimeoutHandler temporarily supported Flusher interface during development of 1.13 but it's no longer supported. This change corrects its documentation.

Fixes golang#35161
Updates golang#34439
@gopherbot
Copy link

Change https://golang.org/cl/203478 mentions this issue: net/http: fix comment TimeoutHandler no longer supports Flusher

@golang golang locked and limited conversation to collaborators Oct 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants