refactor: change deprecated "io/ioutil" package to recommended "io" package

This commit is contained in:
am3o 2024-02-17 12:47:22 +01:00
parent 35984c0876
commit acce1f1fd9
No known key found for this signature in database
GPG key ID: F76214F50EEA64B5
14 changed files with 25 additions and 39 deletions

View file

@ -4,7 +4,6 @@ import (
"bytes"
"errors"
"io"
"io/ioutil"
"log"
"math/rand"
"net/http"
@ -71,7 +70,7 @@ func (r *httpRendezvous) Exchange(encPollReq []byte) ([]byte, error) {
}
func limitedRead(r io.Reader, limit int64) ([]byte, error) {
p, err := ioutil.ReadAll(&io.LimitedReader{R: r, N: limit + 1})
p, err := io.ReadAll(&io.LimitedReader{R: r, N: limit + 1})
if err != nil {
return p, err
} else if int64(len(p)) == limit+1 {