Handle ioutil deprecations (#53526)
* replace ioutil.ReadFile -> os.ReadFile * replace ioutil.ReadAll -> io.ReadAll * replace ioutil.TempFile -> os.CreateTemp * replace ioutil.NopCloser -> io.NopCloser * replace ioutil.WriteFile -> os.WriteFile * replace ioutil.TempDir -> os.MkdirTemp * replace ioutil.Discard -> io.Discard
This commit is contained in:
@@ -2,7 +2,7 @@ package cloudwatch
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
func loadGetMetricDataOutputsFromFile(filePath string) ([]*cloudwatch.GetMetricDataOutput, error) {
|
||||
var getMetricDataOutputs []*cloudwatch.GetMetricDataOutput
|
||||
cleanFilePath := filepath.Clean(filePath)
|
||||
jsonBody, err := ioutil.ReadFile(cleanFilePath)
|
||||
jsonBody, err := os.ReadFile(cleanFilePath)
|
||||
if err != nil {
|
||||
return getMetricDataOutputs, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user