Unexport NewResponseWriter

This commit is contained in:
Adnan Maolood 2021-02-23 22:02:45 -05:00
parent 9eae88f00c
commit 310bd16344
3 changed files with 3 additions and 4 deletions

View File

@ -130,8 +130,7 @@ type ResponseWriter struct {
conn net.Conn
}
// NewResponseWriter returns a ResponseWriter that uses the provided io.WriteCloser.
func NewResponseWriter(w io.WriteCloser) *ResponseWriter {
func newResponseWriter(w io.WriteCloser) *ResponseWriter {
return &ResponseWriter{
bw: bufio.NewWriter(w),
cl: w,

View File

@ -109,7 +109,7 @@ func TestReadWriteResponse(t *testing.T) {
}
var b strings.Builder
w := NewResponseWriter(nopCloser{&b})
w := newResponseWriter(nopCloser{&b})
w.WriteHeader(test.Status, test.Meta)
io.Copy(w, strings.NewReader(test.Body))
if err := w.Flush(); err != nil {

View File

@ -359,7 +359,7 @@ func (srv *Server) serveConn(ctx context.Context, conn net.Conn) error {
rc: conn,
}
w := NewResponseWriter(cw)
w := newResponseWriter(cw)
w.conn = conn
req, err := ReadRequest(r)