File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,15 @@ func (r *bodyWriter) WriteHeader(code int) {
55
55
56
56
// implements http.Flusher
57
57
func (w * bodyWriter ) Flush () {
58
- if w .ResponseWriter .(http.Flusher ) != nil {
59
- w .ResponseWriter .(http.Flusher ).Flush ()
58
+ if f , ok := w .ResponseWriter .(http.Flusher ); ok {
59
+ f .ResponseWriter .(http.Flusher ).Flush ()
60
60
}
61
61
}
62
62
63
63
// implements http.Hijacker
64
64
func (w * bodyWriter ) Hijack () (net.Conn , * bufio.ReadWriter , error ) {
65
- if w .ResponseWriter .(http.Hijacker ) != nil {
66
- return w .ResponseWriter .(http.Hijacker ).Hijack ()
65
+ if hi , ok := w .ResponseWriter .(http.Hijacker ); ok {
66
+ return hi .ResponseWriter .(http.Hijacker ).Hijack ()
67
67
}
68
68
69
69
return nil , nil , errors .New ("Hijack not supported" )
You can’t perform that action at this time.
0 commit comments