1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-03 22:59:09 +02:00

Replace "io/ioutil"

"io/ioutil" pakcage has been deprecated since Go 1.16.
This commit is contained in:
zeek
2022-11-21 21:29:43 +09:00
committed by Martti T
parent be23ab67cc
commit 3c4d3b3083
12 changed files with 37 additions and 40 deletions

View File

@@ -4,7 +4,6 @@ import (
"bufio"
"compress/gzip"
"io"
"io/ioutil"
"net"
"net/http"
"strings"
@@ -89,7 +88,7 @@ func GzipWithConfig(config GzipConfig) echo.MiddlewareFunc {
// nothing is written to body or error is returned.
// See issue #424, #407.
res.Writer = rw
w.Reset(ioutil.Discard)
w.Reset(io.Discard)
}
w.Close()
pool.Put(w)
@@ -135,7 +134,7 @@ func (w *gzipResponseWriter) Push(target string, opts *http.PushOptions) error {
func gzipCompressPool(config GzipConfig) sync.Pool {
return sync.Pool{
New: func() interface{} {
w, err := gzip.NewWriterLevel(ioutil.Discard, config.Level)
w, err := gzip.NewWriterLevel(io.Discard, config.Level)
if err != nil {
return err
}