chore: switch from iouitil to io.ReadAll (#272)

removed a TODO: switch to io.ReadAll and drop go1.15 support
This commit is contained in:
Tim Möhlmann 2023-02-06 09:29:25 +02:00 committed by GitHub
parent cdf2af6c2c
commit df5a09f813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 20 deletions

View file

@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"io"
"net/http"
"os"
"strings"
@ -71,7 +71,7 @@ func main() {
}
defer file.Close()
key, err := ioutil.ReadAll(file)
key, err := io.ReadAll(file)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
@ -161,7 +161,7 @@ func callExampleEndpoint(client *http.Client, testURL string) (interface{}, erro
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}