Remove ResponseWriter.Close method

This commit is contained in:
Adnan Maolood
2021-02-24 19:00:09 -05:00
parent 1bc5c68c3f
commit 1764e02d1e
3 changed files with 7 additions and 25 deletions

View File

@@ -147,10 +147,6 @@ type ResponseWriter interface {
// Flush sends any buffered data to the client.
Flush() error
// Close closes the connection.
// Any blocked Write operations will be unblocked and return errors.
Close() error
}
type responseWriter struct {
@@ -161,10 +157,9 @@ type responseWriter struct {
bodyAllowed bool
}
func newResponseWriter(w io.WriteCloser) *responseWriter {
func newResponseWriter(w io.Writer) *responseWriter {
return &responseWriter{
bw: bufio.NewWriter(w),
cl: w,
}
}
@@ -210,7 +205,3 @@ func (w *responseWriter) Flush() error {
// Write errors from WriteHeader will be returned here.
return w.bw.Flush()
}
func (w *responseWriter) Close() error {
return w.cl.Close()
}