chore: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
@@ -18,7 +18,6 @@ package mux
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
@@ -152,7 +151,7 @@ func TestGorillizeReturnsAMuxThatRespectsRouteOrderAB(t *testing.T) {
|
||||
|
||||
res := w.Result()
|
||||
|
||||
if body, _ := ioutil.ReadAll(res.Body); string(body) != "routeA" {
|
||||
if body, _ := io.ReadAll(res.Body); string(body) != "routeA" {
|
||||
t.Errorf("Mux did not respect route order %q", body)
|
||||
}
|
||||
}
|
||||
@@ -180,7 +179,7 @@ func TestGorillizeReturnsAMuxThatRespectsRouteOrderBA(t *testing.T) {
|
||||
|
||||
res := w.Result()
|
||||
|
||||
if body, _ := ioutil.ReadAll(res.Body); string(body) != "routeB" {
|
||||
if body, _ := io.ReadAll(res.Body); string(body) != "routeB" {
|
||||
t.Errorf("Mux did not respect route order %q", body)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/BBVA/kapow/internal/logger"
|
||||
@@ -90,7 +90,7 @@ func Run(bindAddr string, wg *sync.WaitGroup, certFile, keyFile, cliCaFile strin
|
||||
func loadCertificatesFromFile(certFile string) (pool *x509.CertPool, err error) {
|
||||
if certFile != "" {
|
||||
var caCerts []byte
|
||||
caCerts, err = ioutil.ReadFile(certFile)
|
||||
caCerts, err = os.ReadFile(certFile)
|
||||
if err == nil {
|
||||
pool = x509.NewCertPool()
|
||||
if !pool.AppendCertsFromPEM(caCerts) {
|
||||
|
||||
Reference in New Issue
Block a user