Skip to content

Commit

Permalink
removing deprecated http closenotifier function (#6886)
Browse files Browse the repository at this point in the history
  • Loading branch information
miledxz authored Dec 21, 2023
1 parent bb0d32f commit 4f03f3f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/transport/handler_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ func (s) TestHandlerTransport_NewServerHandlerTransport(t *testing.T) {
// Return w without its Flush method
type onlyCloseNotifier interface {
http.ResponseWriter
http.CloseNotifier
}
return struct{ onlyCloseNotifier }{w.(onlyCloseNotifier)}
},
Expand Down Expand Up @@ -196,7 +195,6 @@ func (s) TestHandlerTransport_NewServerHandlerTransport(t *testing.T) {
rrec := httptest.NewRecorder()
rw := http.ResponseWriter(testHandlerResponseWriter{
ResponseRecorder: rrec,
closeNotify: make(chan bool, 1),
})

if tt.modrw != nil {
Expand Down Expand Up @@ -227,16 +225,13 @@ func (s) TestHandlerTransport_NewServerHandlerTransport(t *testing.T) {

type testHandlerResponseWriter struct {
*httptest.ResponseRecorder
closeNotify chan bool
}

func (w testHandlerResponseWriter) CloseNotify() <-chan bool { return w.closeNotify }
func (w testHandlerResponseWriter) Flush() {}
func (w testHandlerResponseWriter) Flush() {}

func newTestHandlerResponseWriter() http.ResponseWriter {
return testHandlerResponseWriter{
ResponseRecorder: httptest.NewRecorder(),
closeNotify: make(chan bool, 1),
}
}

Expand Down

0 comments on commit 4f03f3f

Please sign in to comment.