migrate away from deprecated ioutil APIs (#7175)

Co-authored-by: Callum Waters <cmwaters19@gmail.com>
Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
Sharad Chand
2021-10-28 23:19:07 +05:45
committed by GitHub
parent 6108d0a9b5
commit 8441b3715a
58 changed files with 158 additions and 192 deletions

View File

@@ -2,7 +2,6 @@ package internal
import (
"fmt"
"io/ioutil"
"os"
"testing"
"time"
@@ -187,7 +186,7 @@ func cleanup(cfg TestHarnessConfig) {
}
func makeTempFile(name, content string) string {
tempFile, err := ioutil.TempFile("", fmt.Sprintf("%s-*", name))
tempFile, err := os.CreateTemp("", fmt.Sprintf("%s-*", name))
if err != nil {
panic(err)
}

View File

@@ -3,7 +3,6 @@ package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
@@ -149,7 +148,7 @@ func extractKey(tmhome, outputPath string) {
os.Exit(1)
}
pkb := []byte(fpv.Key.PrivKey.(ed25519.PrivKey))
if err := ioutil.WriteFile(internal.ExpandPath(outputPath), pkb[:32], 0600); err != nil {
if err := os.WriteFile(internal.ExpandPath(outputPath), pkb[:32], 0600); err != nil {
logger.Info("Failed to write private key", "output", outputPath, "err", err)
os.Exit(1)
}