io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os
This commit is contained in:
@@ -22,7 +22,7 @@ package e2enode
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -51,7 +51,7 @@ func dumpDataToFile(data interface{}, labels map[string]string, prefix string) {
|
||||
fileName := path.Join(framework.TestContext.ReportDir, fmt.Sprintf("%s-%s-%s.json", prefix, framework.TestContext.ReportPrefix, testName))
|
||||
labels["timestamp"] = strconv.FormatInt(time.Now().UTC().Unix(), 10)
|
||||
framework.Logf("Dumping perf data for test %q to %q.", testName, fileName)
|
||||
if err := ioutil.WriteFile(fileName, []byte(framework.PrettyPrintJSON(data)), 0644); err != nil {
|
||||
if err := os.WriteFile(fileName, []byte(framework.PrettyPrintJSON(data)), 0644); err != nil {
|
||||
framework.Logf("Failed to write perf data for test %q to %q: %v", testName, fileName, err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user