mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 21:06:39 +08:00
remove closenotify
This commit is contained in:
parent
ef2a073e0f
commit
1affd309f0
@ -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()
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user