Skip to content
Myr

add supprt for go1.20 http.rwUnwrapper to gin.responseWriter (#3489)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Desmarais-Michaud · committed by GitHub · parent bd82c9e · Browse files · 2 files+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−0 removed

  • other:+10 added−0 removed

2 files+10 added−0 removed

modified:response_writer_test.go+6 added
28 unmodified lines
29func init() {30 SetMode(TestMode)31}3233func TestResponseWriterUnwrap(t *testing.T) {34 testWriter := httptest.NewRecorder()35 writer := &responseWriter{ResponseWriter: testWriter}36 assert.Same(t, testWriter, writer.Unwrap())37}3839func TestResponseWriterReset(t *testing.T) {40 testWriter := httptest.NewRecorder()41 writer := &responseWriter{}42 var w ResponseWriter = writer
116 unmodified lines
modified:response_writer.go+4 added
49 unmodified lines
50}5152var _ ResponseWriter = (*responseWriter)(nil)5354func (w *responseWriter) Unwrap() http.ResponseWriter {55 return w.ResponseWriter56}5758func (w *responseWriter) reset(writer http.ResponseWriter) {59 w.ResponseWriter = writer60 w.size = noWritten61 w.status = defaultStatus
70 unmodified lines