Skip to content
Snippets Groups Projects
Commit b1ef4b49 authored by 流雨声's avatar 流雨声 Committed by Alex Ellis
Browse files

fix: use io.ReadAll replace ioutil.ReadAll


ioutil.ReadAll will delete in future

Signed-off-by: default avatar流雨声 <212724256@qq.com>
parent f9245ebb
No related branches found
No related tags found
No related merge requests found
...@@ -5,10 +5,9 @@ package handlers ...@@ -5,10 +5,9 @@ package handlers
import ( import (
"encoding/json" "encoding/json"
"io"
"log" "log"
"net/http" "net/http"
"io/ioutil"
"net/http/httptest" "net/http/httptest"
providerTypes "github.com/openfaas/faas-provider/types" providerTypes "github.com/openfaas/faas-provider/types"
...@@ -27,7 +26,7 @@ func MakeInfoHandler(h http.Handler) http.HandlerFunc { ...@@ -27,7 +26,7 @@ func MakeInfoHandler(h http.Handler) http.HandlerFunc {
var provider *providerTypes.ProviderInfo var provider *providerTypes.ProviderInfo
upstreamBody, _ := ioutil.ReadAll(upstreamCall.Body) upstreamBody, _ := io.ReadAll(upstreamCall.Body)
err := json.Unmarshal(upstreamBody, &provider) err := json.Unmarshal(upstreamBody, &provider)
if err != nil { if err != nil {
log.Printf("Error unmarshalling provider json from body %s. Error %s\n", upstreamBody, err.Error()) log.Printf("Error unmarshalling provider json from body %s. Error %s\n", upstreamBody, err.Error())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment