Remove ioutil usage

This has been deprecated in Go for some time, in favour of the
io package.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2023-08-22 18:29:28 +01:00
parent 55776acc0d
commit 2a88b5d2f7
8 changed files with 21 additions and 20 deletions

View File

@ -3,7 +3,7 @@ package metrics
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
)
@ -44,7 +44,7 @@ func (q PrometheusQuery) Fetch(query string) (*VectorQueryResponse, error) {
defer res.Body.Close()
}
bytesOut, readErr := ioutil.ReadAll(res.Body)
bytesOut, readErr := io.ReadAll(res.Body)
if readErr != nil {
return nil, readErr
}