1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

CHORE: Remove deprecated io/ioutil (#1699)

* Remove deprecated io/ioutil

* fixup!

* fixup!
This commit is contained in:
Tom Limoncelli
2022-08-14 12:50:15 -04:00
committed by GitHub
parent 5e8bb6e461
commit cd61c2c766
25 changed files with 77 additions and 85 deletions

View File

@@ -6,15 +6,16 @@ package rwth
import (
"encoding/json"
"fmt"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/miekg/dns"
"io/ioutil"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/StackExchange/dnscontrol/v3/models"
"github.com/StackExchange/dnscontrol/v3/pkg/printer"
"github.com/miekg/dns"
)
const (
@@ -188,7 +189,7 @@ func (api *rwthProvider) request(endpoint string, method string, request url.Val
defer cleanupResponseBody()
if resp.StatusCode != http.StatusOK {
data, _ := ioutil.ReadAll(resp.Body)
data, _ := io.ReadAll(resp.Body)
printer.Printf(string(data))
return fmt.Errorf("bad status code from RWTH: %d not 200", resp.StatusCode)
}