mirror of
https://github.com/openfaas/faas.git
synced 2025-06-20 13:06:40 +00:00
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:
@ -6,7 +6,7 @@ package handlers
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"log"
|
||||
"math"
|
||||
"net/http"
|
||||
@ -27,7 +27,7 @@ func MakeAlertHandler(service scaling.ServiceQuery, defaultNamespace string) htt
|
||||
|
||||
defer r.Body.Close()
|
||||
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
body, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
w.Write([]byte("Unable to read alert."))
|
||||
|
Reference in New Issue
Block a user