replace deprecated method

This commit is contained in:
Charles Xu
2023-09-18 10:16:48 +00:00
parent 03721e8c7e
commit 7833ca8bc6
11 changed files with 19 additions and 22 deletions

View File

@ -5,7 +5,7 @@ import (
"context"
"crypto/tls"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
@ -172,7 +172,7 @@ func (ex *exchanger) dohExchange(ctx context.Context, msg []byte) ([]byte, error
}
// Read wireformat response from the body
buf, err := ioutil.ReadAll(resp.Body)
buf, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read the response body: %w", err)
}