remove closenotify

This commit is contained in:
Glonee 2023-05-27 00:55:02 +08:00
parent ef2a073e0f
commit 1affd309f0
No known key found for this signature in database
GPG Key ID: 647C8F09A5A4BB89
2 changed files with 0 additions and 11 deletions

View File

@ -21,7 +21,6 @@ type ResponseWriter interface {
http.ResponseWriter
http.Hijacker
http.Flusher
http.CloseNotifier
// Status returns the HTTP response status code of the current request.
Status() int
@ -112,11 +111,6 @@ func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return w.ResponseWriter.(http.Hijacker).Hijack()
}
// CloseNotify implements the http.CloseNotifier interface.
func (w *responseWriter) CloseNotify() <-chan bool {
return w.ResponseWriter.(http.CloseNotifier).CloseNotify()
}
// Flush implements the http.Flusher interface.
func (w *responseWriter) Flush() {
w.WriteHeaderNow()

View File

@ -23,7 +23,6 @@ var (
_ http.ResponseWriter = ResponseWriter(&responseWriter{})
_ http.Hijacker = ResponseWriter(&responseWriter{})
_ http.Flusher = ResponseWriter(&responseWriter{})
_ http.CloseNotifier = ResponseWriter(&responseWriter{})
)
func init() {
@ -116,10 +115,6 @@ func TestResponseWriterHijack(t *testing.T) {
})
assert.True(t, w.Written())
assert.Panics(t, func() {
w.CloseNotify()
})
w.Flush()
}