mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-16 21:32:11 +08:00
remove closenotify
This commit is contained in:
parent
ef2a073e0f
commit
1affd309f0
@ -21,7 +21,6 @@ type ResponseWriter interface {
|
|||||||
http.ResponseWriter
|
http.ResponseWriter
|
||||||
http.Hijacker
|
http.Hijacker
|
||||||
http.Flusher
|
http.Flusher
|
||||||
http.CloseNotifier
|
|
||||||
|
|
||||||
// Status returns the HTTP response status code of the current request.
|
// Status returns the HTTP response status code of the current request.
|
||||||
Status() int
|
Status() int
|
||||||
@ -112,11 +111,6 @@ func (w *responseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
|
|||||||
return w.ResponseWriter.(http.Hijacker).Hijack()
|
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.
|
// Flush implements the http.Flusher interface.
|
||||||
func (w *responseWriter) Flush() {
|
func (w *responseWriter) Flush() {
|
||||||
w.WriteHeaderNow()
|
w.WriteHeaderNow()
|
||||||
|
@ -23,7 +23,6 @@ var (
|
|||||||
_ http.ResponseWriter = ResponseWriter(&responseWriter{})
|
_ http.ResponseWriter = ResponseWriter(&responseWriter{})
|
||||||
_ http.Hijacker = ResponseWriter(&responseWriter{})
|
_ http.Hijacker = ResponseWriter(&responseWriter{})
|
||||||
_ http.Flusher = ResponseWriter(&responseWriter{})
|
_ http.Flusher = ResponseWriter(&responseWriter{})
|
||||||
_ http.CloseNotifier = ResponseWriter(&responseWriter{})
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -116,10 +115,6 @@ func TestResponseWriterHijack(t *testing.T) {
|
|||||||
})
|
})
|
||||||
assert.True(t, w.Written())
|
assert.True(t, w.Written())
|
||||||
|
|
||||||
assert.Panics(t, func() {
|
|
||||||
w.CloseNotify()
|
|
||||||
})
|
|
||||||
|
|
||||||
w.Flush()
|
w.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user