diff --git a/.golangci.yml b/.golangci.yml index d1ddf8f910..98ef1416ba 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -62,8 +62,6 @@ issues: - ineffective break statement. Did you mean to break out of the outer loop # revive: irrelevant error about naming - "var-naming: don't use leading k in Go names" - # staticcheck: we'll keep using ioutil for now - - 'SA1019: "io/ioutil" has been deprecated since Go 1.16' exclude-rules: # Add all linters here -- Comment this block out for testing linters diff --git a/agreement/fuzzer/tests_test.go b/agreement/fuzzer/tests_test.go index 75a0cc67cf..2dfc837072 100644 --- a/agreement/fuzzer/tests_test.go +++ b/agreement/fuzzer/tests_test.go @@ -20,7 +20,6 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" "log" "math" "math/rand" @@ -440,7 +439,7 @@ func TestFuzzer(t *testing.T) { t.Run(testName, func(t *testing.T) { partitiontest.PartitionTest(t) // Check if this expect test should by run, may SKIP jsonFilename := jsonFiles[testName] - jsonBytes, err := ioutil.ReadFile(jsonFilename) + jsonBytes, err := os.ReadFile(jsonFilename) require.NoError(t, err) var fuzzerTest FuzzerTestFile err = json.Unmarshal(jsonBytes, &fuzzerTest) diff --git a/cmd/algod/main.go b/cmd/algod/main.go index b0a45bc6ae..3e4162bf30 100644 --- a/cmd/algod/main.go +++ b/cmd/algod/main.go @@ -19,7 +19,6 @@ package main import ( "flag" "fmt" - "io/ioutil" "math/rand" "os" "path/filepath" @@ -119,7 +118,7 @@ func run() int { } // Load genesis - genesisText, err := ioutil.ReadFile(genesisPath) + genesisText, err := os.ReadFile(genesisPath) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read genesis file %s: %v\n", genesisPath, err) return 1 diff --git a/cmd/algod/main_test.go b/cmd/algod/main_test.go index 13fa72092b..c25505167c 100644 --- a/cmd/algod/main_test.go +++ b/cmd/algod/main_test.go @@ -18,7 +18,6 @@ package main import ( "fmt" - "io/ioutil" "os" "path/filepath" "testing" @@ -30,7 +29,7 @@ import ( func BenchmarkAlgodStartup(b *testing.B) { tmpDir := b.TempDir() - genesisFile, err := ioutil.ReadFile("../../installer/genesis/devnet/genesis.json") + genesisFile, err := os.ReadFile("../../installer/genesis/devnet/genesis.json") require.NoError(b, err) dataDirectory = &tmpDir @@ -38,7 +37,7 @@ func BenchmarkAlgodStartup(b *testing.B) { initAndExit = &bInitAndExit b.StartTimer() for n := 0; n < b.N; n++ { - err := ioutil.WriteFile(filepath.Join(tmpDir, config.GenesisJSONFile), genesisFile, 0766) + err := os.WriteFile(filepath.Join(tmpDir, config.GenesisJSONFile), genesisFile, 0766) require.NoError(b, err) fmt.Printf("file %s was written\n", filepath.Join(tmpDir, config.GenesisJSONFile)) run() diff --git a/cmd/algofix/main.go b/cmd/algofix/main.go index 66585e42c8..09df524928 100644 --- a/cmd/algofix/main.go +++ b/cmd/algofix/main.go @@ -13,7 +13,7 @@ import ( "go/parser" "go/scanner" "go/token" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -135,7 +135,7 @@ func processFile(filename string, useStdin bool) error { defer f.Close() } - src, err := ioutil.ReadAll(f) + src, err := io.ReadAll(f) if err != nil { return err } @@ -209,7 +209,7 @@ func processFile(filename string, useStdin bool) error { } fixedSome = true - return ioutil.WriteFile(f.Name(), newSrc, 0) + return os.WriteFile(f.Name(), newSrc, 0) } var gofmtBuf bytes.Buffer @@ -248,7 +248,7 @@ func isGoFile(f os.FileInfo) bool { } func writeTempFile(dir, prefix string, data []byte) (string, error) { - file, err := ioutil.TempFile(dir, prefix) + file, err := os.CreateTemp(dir, prefix) if err != nil { return "", err } diff --git a/cmd/algofix/typecheck.go b/cmd/algofix/typecheck.go index 4550fe4f98..2b55355a26 100644 --- a/cmd/algofix/typecheck.go +++ b/cmd/algofix/typecheck.go @@ -9,7 +9,6 @@ import ( "go/ast" "go/parser" "go/token" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -161,12 +160,12 @@ func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, ass if err != nil { return err } - dir, err := ioutil.TempDir(os.TempDir(), "fix_cgo_typecheck") + dir, err := os.MkdirTemp(os.TempDir(), "fix_cgo_typecheck") if err != nil { return err } defer os.RemoveAll(dir) - err = ioutil.WriteFile(filepath.Join(dir, "in.go"), txt, 0600) + err = os.WriteFile(filepath.Join(dir, "in.go"), txt, 0600) if err != nil { return err } @@ -175,7 +174,7 @@ func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, ass if err != nil { return err } - out, err := ioutil.ReadFile(filepath.Join(dir, "_cgo_gotypes.go")) + out, err := os.ReadFile(filepath.Join(dir, "_cgo_gotypes.go")) if err != nil { return err } diff --git a/cmd/algoh/main.go b/cmd/algoh/main.go index a458929aa2..4e75ae837b 100644 --- a/cmd/algoh/main.go +++ b/cmd/algoh/main.go @@ -19,7 +19,6 @@ package main import ( "flag" "fmt" - "io/ioutil" "os" "os/exec" "os/signal" @@ -351,8 +350,8 @@ func captureErrorLogs(algohConfig algoh.HostConfig, errorOutput stdCollector, ou log.EventWithDetails(telemetryspec.HostApplicationState, telemetryspec.ErrorOutputEvent, details) // Write stdout & stderr streams to disk - _ = ioutil.WriteFile(filepath.Join(absolutePath, nodecontrol.StdOutFilename), []byte(output.output), os.ModePerm) - _ = ioutil.WriteFile(filepath.Join(absolutePath, nodecontrol.StdErrFilename), []byte(errorOutput.output), os.ModePerm) + _ = os.WriteFile(filepath.Join(absolutePath, nodecontrol.StdOutFilename), []byte(output.output), os.ModePerm) + _ = os.WriteFile(filepath.Join(absolutePath, nodecontrol.StdErrFilename), []byte(errorOutput.output), os.ModePerm) } if errorCondition && algohConfig.UploadOnError { fmt.Fprintf(os.Stdout, "Uploading logs...\n") diff --git a/cmd/algokey/common.go b/cmd/algokey/common.go index 37f4e1ca47..9362fab74f 100644 --- a/cmd/algokey/common.go +++ b/cmd/algokey/common.go @@ -18,7 +18,7 @@ package main import ( "fmt" - "io/ioutil" + "io" "os" "github.com/algorand/go-algorand/crypto" @@ -63,7 +63,7 @@ func loadMnemonic(mnemonic string) crypto.Seed { } func loadKeyfile(keyfile string) crypto.Seed { - seedbytes, err := ioutil.ReadFile(keyfile) + seedbytes, err := os.ReadFile(keyfile) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read key seed from %s: %v\n", keyfile, err) os.Exit(1) @@ -75,7 +75,7 @@ func loadKeyfile(keyfile string) crypto.Seed { } func writePrivateKey(keyfile string, seed crypto.Seed) { - err := ioutil.WriteFile(keyfile, seed[:], 0600) + err := os.WriteFile(keyfile, seed[:], 0600) if err != nil { fmt.Fprintf(os.Stderr, "Cannot write key to %s: %v\n", keyfile, err) os.Exit(1) @@ -84,7 +84,7 @@ func writePrivateKey(keyfile string, seed crypto.Seed) { func writePublicKey(pubkeyfile string, checksummed string) { data := fmt.Sprintf("%s\n", checksummed) - err := ioutil.WriteFile(pubkeyfile, []byte(data), 0666) + err := os.WriteFile(pubkeyfile, []byte(data), 0666) if err != nil { fmt.Fprintf(os.Stderr, "Cannot write public key to %s: %v\n", pubkeyfile, err) os.Exit(1) @@ -100,7 +100,7 @@ func computeMnemonic(seed crypto.Seed) string { return mnemonic } -// writeFile is a wrapper of ioutil.WriteFile which considers the special +// writeFile is a wrapper of os.WriteFile which considers the special // case of stdout filename func writeFile(filename string, data []byte, perm os.FileMode) error { var err error @@ -111,14 +111,14 @@ func writeFile(filename string, data []byte, perm os.FileMode) error { } return nil } - return ioutil.WriteFile(filename, data, perm) + return os.WriteFile(filename, data, perm) } -// readFile is a wrapper of ioutil.ReadFile which considers the +// readFile is a wrapper of os.ReadFile which considers the // special case of stdin filename func readFile(filename string) ([]byte, error) { if filename == stdinFileNameValue { - return ioutil.ReadAll(os.Stdin) + return io.ReadAll(os.Stdin) } - return ioutil.ReadFile(filename) + return os.ReadFile(filename) } diff --git a/cmd/algokey/keyreg.go b/cmd/algokey/keyreg.go index 7b3bf5ef82..156697e7fc 100644 --- a/cmd/algokey/keyreg.go +++ b/cmd/algokey/keyreg.go @@ -20,7 +20,6 @@ import ( "encoding/base64" "errors" "fmt" - "io/ioutil" "os" "strings" @@ -248,7 +247,7 @@ func run(params keyregCmdParams) error { return fmt.Errorf("failed to write transaction to stdout: %w", err) } } else { - if err = ioutil.WriteFile(params.txFile, data, 0600); err != nil { + if err = os.WriteFile(params.txFile, data, 0600); err != nil { return fmt.Errorf("failed to write transaction to '%s': %w", params.txFile, err) } } diff --git a/cmd/algokey/multisig.go b/cmd/algokey/multisig.go index 97b5c17319..b6d0bb108a 100644 --- a/cmd/algokey/multisig.go +++ b/cmd/algokey/multisig.go @@ -19,7 +19,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "strconv" "strings" @@ -66,7 +65,7 @@ var multisigCmd = &cobra.Command{ seed := loadKeyfileOrMnemonic(multisigKeyfile, multisigMnemonic) key := crypto.GenerateSignatureSecrets(seed) - txdata, err := ioutil.ReadFile(multisigTxfile) + txdata, err := os.ReadFile(multisigTxfile) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read transactions from %s: %v\n", multisigTxfile, err) os.Exit(1) @@ -101,7 +100,7 @@ var multisigCmd = &cobra.Command{ outBytes = append(outBytes, protocol.Encode(&stxn)...) } - err = ioutil.WriteFile(multisigOutfile, outBytes, 0600) + err = os.WriteFile(multisigOutfile, outBytes, 0600) if err != nil { fmt.Fprintf(os.Stderr, "Cannot write signed transactions to %s: %v\n", multisigOutfile, err) os.Exit(1) diff --git a/cmd/algokey/sign.go b/cmd/algokey/sign.go index 226df50948..14f14e58b5 100644 --- a/cmd/algokey/sign.go +++ b/cmd/algokey/sign.go @@ -19,7 +19,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "github.com/spf13/cobra" @@ -52,7 +51,7 @@ var signCmd = &cobra.Command{ seed := loadKeyfileOrMnemonic(signKeyfile, signMnemonic) key := crypto.GenerateSignatureSecrets(seed) - txdata, err := ioutil.ReadFile(signTxfile) + txdata, err := os.ReadFile(signTxfile) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read transactions from %s: %v\n", signTxfile, err) os.Exit(1) @@ -78,7 +77,7 @@ var signCmd = &cobra.Command{ outBytes = append(outBytes, protocol.Encode(&stxn)...) } - err = ioutil.WriteFile(signOutfile, outBytes, 0600) + err = os.WriteFile(signOutfile, outBytes, 0600) if err != nil { fmt.Fprintf(os.Stderr, "Cannot write signed transactions to %s: %v\n", signOutfile, err) os.Exit(1) diff --git a/cmd/algons/dnsCmd.go b/cmd/algons/dnsCmd.go index c6b6a54f86..a1771414c1 100644 --- a/cmd/algons/dnsCmd.go +++ b/cmd/algons/dnsCmd.go @@ -20,7 +20,6 @@ import ( "bufio" "context" "fmt" - "io/ioutil" "net" "os" "regexp" @@ -477,7 +476,7 @@ func doExportZone(network string, outputFilename string) bool { return false } if outputFilename != "" { - err = ioutil.WriteFile(outputFilename, exportedZone, 0666) + err = os.WriteFile(outputFilename, exportedZone, 0666) if err != nil { fmt.Fprintf(os.Stderr, "Unable to write exported zone file : %v\n", err) return false diff --git a/cmd/buildtools/genesis.go b/cmd/buildtools/genesis.go index 98cb60ca67..e1aab257ae 100644 --- a/cmd/buildtools/genesis.go +++ b/cmd/buildtools/genesis.go @@ -18,7 +18,6 @@ package main import ( "fmt" - "io/ioutil" "os" "path/filepath" "time" @@ -102,7 +101,7 @@ var timestampCmd = &cobra.Command{ // Write out the genesis file in the same way we do to generate originally // (see gen/generate.go) jsonData := protocol.EncodeJSON(genesis) - err = ioutil.WriteFile(timestampFile, append(jsonData, '\n'), 0666) + err = os.WriteFile(timestampFile, append(jsonData, '\n'), 0666) if err != nil { reportErrorf("Error saving genesis file '%s': %v\n", timestampFile, err) } @@ -117,7 +116,7 @@ var dumpGenesisIDCmd = &cobra.Command{ Short: "Dump the genesis ID for the specified genesis file", Run: func(cmd *cobra.Command, args []string) { // Load genesis - genesisText, err := ioutil.ReadFile(genesisFile) + genesisText, err := os.ReadFile(genesisFile) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read genesis file %s: %v\n", genesisFile, err) os.Exit(1) @@ -139,7 +138,7 @@ var dumpGenesisHashCmd = &cobra.Command{ Short: "Dump the genesis Hash for the specified genesis file", Run: func(cmd *cobra.Command, args []string) { // Load genesis - genesisText, err := ioutil.ReadFile(genesisFile) + genesisText, err := os.ReadFile(genesisFile) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read genesis file %s: %v\n", genesisFile, err) os.Exit(1) @@ -206,7 +205,7 @@ var ensureCmd = &cobra.Command{ } else { // Write source genesis (now updated with release timestamp, if applicable) jsonData := protocol.EncodeJSON(sourceGenesis) - err = ioutil.WriteFile(targetFile, jsonData, 0666) + err = os.WriteFile(targetFile, jsonData, 0666) if err != nil { reportErrorf("Error writing target genesis file '%s': %v\n", targetFile, err) } @@ -231,13 +230,13 @@ func ensureReleaseGenesis(src bookkeeping.Genesis, releaseFile string) (err erro releaseGenesis = src jsonData := protocol.EncodeJSON(releaseGenesis) - err = ioutil.WriteFile(releaseFile, jsonData, 0666) + err = os.WriteFile(releaseFile, jsonData, 0666) if err != nil { return fmt.Errorf("error saving file: %v", err) } hash := releaseGenesis.Hash() - err = ioutil.WriteFile(releaseFileHash, []byte(hash.String()), 0666) + err = os.WriteFile(releaseFileHash, []byte(hash.String()), 0666) if err != nil { return fmt.Errorf("error saving hash file '%s': %v", releaseFileHash, err) } @@ -278,7 +277,7 @@ func verifyGenesisHashes(src, release bookkeeping.Genesis, hashFile string) (err return fmt.Errorf("source and release hashes differ - genesis.json may have diverge from released version") } - relHashBytes, err := ioutil.ReadFile(hashFile) + relHashBytes, err := os.ReadFile(hashFile) if err != nil { return fmt.Errorf("error loading release hash file '%s'", hashFile) } diff --git a/cmd/catchupsrv/download.go b/cmd/catchupsrv/download.go index 813da9d03b..6a5880d42a 100644 --- a/cmd/catchupsrv/download.go +++ b/cmd/catchupsrv/download.go @@ -20,7 +20,7 @@ import ( "context" "flag" "fmt" - "io/ioutil" + "io" "net" "net/http" "os" @@ -138,7 +138,7 @@ func fetchBlock(server string, blk uint64) error { return fmt.Errorf("HTTP response: %s", resp.Status) } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return err } @@ -156,7 +156,7 @@ func fetchBlock(server string, blk uint64) error { panic(err) } - return ioutil.WriteFile(fn, body, 0666) + return os.WriteFile(fn, body, 0666) } func fetcher(server string, wg *sync.WaitGroup) { diff --git a/cmd/catchupsrv/main.go b/cmd/catchupsrv/main.go index 86fd9645af..1f0de542aa 100644 --- a/cmd/catchupsrv/main.go +++ b/cmd/catchupsrv/main.go @@ -20,7 +20,6 @@ import ( "encoding/base64" "flag" "fmt" - "io/ioutil" "math/rand" "net/http" "os" @@ -118,7 +117,7 @@ func main() { var data []byte if *dirFlag != "" { blkPath := blockToPath(roundNumber) - data, err = ioutil.ReadFile( + data, err = os.ReadFile( path.Join( *dirFlag, "v"+versionStr, diff --git a/cmd/dbgen/main.go b/cmd/dbgen/main.go index 078f30a3b6..f73809ed76 100644 --- a/cmd/dbgen/main.go +++ b/cmd/dbgen/main.go @@ -21,7 +21,7 @@ package main import ( "flag" "fmt" - "io/ioutil" + "os" "strings" "time" ) @@ -59,13 +59,13 @@ func main() { if *inputfilename == "" { panic("error: No database schema file specified") } - input, err := ioutil.ReadFile(*inputfilename) + input, err := os.ReadFile(*inputfilename) if err != nil { panic(err) } header := "" if *headerfilename != "" { - headerBytes, err := ioutil.ReadFile(*headerfilename) + headerBytes, err := os.ReadFile(*headerfilename) if err != nil { panic(err) } @@ -78,7 +78,7 @@ func main() { if *outputfilename == "" { fmt.Println(payload) } else { - err := ioutil.WriteFile(*outputfilename, []byte(payload), 0666) + err := os.WriteFile(*outputfilename, []byte(payload), 0666) if err != nil { panic(err) } diff --git a/cmd/dispenser/server.go b/cmd/dispenser/server.go index 39ecb41841..d4ec0b5b87 100644 --- a/cmd/dispenser/server.go +++ b/cmd/dispenser/server.go @@ -21,7 +21,7 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" + "io" "log" "net/http" "net/url" @@ -150,7 +150,7 @@ func (cfg dispenserSiteConfig) checkRecaptcha(remoteip, response string) (r reca } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return } @@ -219,7 +219,7 @@ func main() { os.Exit(1) } - configText, err := ioutil.ReadFile(*configFile) + configText, err := os.ReadFile(*configFile) if err != nil { fmt.Fprintf(os.Stderr, "Cannot read config file (%s): %v\n", *configFile, err) os.Exit(1) @@ -237,7 +237,7 @@ func main() { var hosts []string for h, cfg := range configMap { // Make a cache dir for wallet handle tokens - cacheDir, err := ioutil.TempDir("", "dispenser") + cacheDir, err := os.MkdirTemp("", "dispenser") if err != nil { fmt.Fprintf(os.Stderr, "Cannot make temp dir: %v\n", err) os.Exit(1) diff --git a/cmd/goal/account.go b/cmd/goal/account.go index cf40e011cb..62f1b08c80 100644 --- a/cmd/goal/account.go +++ b/cmd/goal/account.go @@ -20,7 +20,6 @@ import ( "bufio" "encoding/base64" "fmt" - "io/ioutil" "os" "path/filepath" "sort" @@ -1291,7 +1290,7 @@ var importRootKeysCmd = &cobra.Command{ } keyDir := filepath.Join(dataDir, genID) - files, err := ioutil.ReadDir(keyDir) + files, err := os.ReadDir(keyDir) if err != nil { return } @@ -1475,7 +1474,7 @@ func listParticipationKeyFiles(c *libgoal.Client) (partKeyFiles map[string]algod // Get a list of files in the participation keys directory keyDir := filepath.Join(c.DataDir(), genID) - files, err := ioutil.ReadDir(keyDir) + files, err := os.ReadDir(keyDir) if err != nil { return } diff --git a/cmd/goal/accountsList.go b/cmd/goal/accountsList.go index 56de35deb8..dc646ffb00 100644 --- a/cmd/goal/accountsList.go +++ b/cmd/goal/accountsList.go @@ -19,7 +19,6 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" "os" "os/user" "path/filepath" @@ -184,7 +183,7 @@ func (accountList *AccountsList) getNameByAddress(address string) string { func (accountList *AccountsList) dumpList() { accountsListJSON, _ := json.MarshalIndent(accountList, "", " ") accountsListJSON = append(accountsListJSON, '\n') - err := ioutil.WriteFile(accountList.accountListFileName(), accountsListJSON, 0644) + err := os.WriteFile(accountList.accountListFileName(), accountsListJSON, 0644) if err != nil { log.Error(err.Error()) @@ -197,7 +196,7 @@ func (accountList *AccountsList) loadList() { // First, check if the file exists. filename := accountList.accountListFileName() if _, err := os.Stat(filename); err == nil { - raw, err := ioutil.ReadFile(filename) + raw, err := os.ReadFile(filename) if err != nil { log.Error(err.Error()) } diff --git a/cmd/goal/commands.go b/cmd/goal/commands.go index 4f93b6fb4b..c6103d259e 100644 --- a/cmd/goal/commands.go +++ b/cmd/goal/commands.go @@ -19,7 +19,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "os/exec" "os/user" @@ -237,7 +236,7 @@ var protoCmd = &cobra.Command{ func readGenesis(dataDir string) (genesis bookkeeping.Genesis, err error) { path := filepath.Join(dataDir, config.GenesisJSONFile) - genesisText, err := ioutil.ReadFile(path) + genesisText, err := os.ReadFile(path) if err != nil { return } @@ -564,7 +563,7 @@ func reportErrorf(format string, args ...interface{}) { reportErrorln(fmt.Sprintf(format, args...)) } -// writeFile is a wrapper of ioutil.WriteFile which considers the special +// writeFile is a wrapper of os.WriteFile which considers the special // case of stdout filename func writeFile(filename string, data []byte, perm os.FileMode) error { var err error @@ -575,7 +574,7 @@ func writeFile(filename string, data []byte, perm os.FileMode) error { } return nil } - return ioutil.WriteFile(filename, data, perm) + return os.WriteFile(filename, data, perm) } // writeDryrunReqToFile creates dryrun request object and writes to a file @@ -593,13 +592,13 @@ func writeDryrunReqToFile(client libgoal.Client, txnOrStxn interface{}, outFilen return } -// readFile is a wrapper of ioutil.ReadFile which considers the +// readFile is a wrapper of os.ReadFile which considers the // special case of stdin filename func readFile(filename string) ([]byte, error) { if filename == stdinFileNameValue { - return ioutil.ReadAll(os.Stdin) + return io.ReadAll(os.Stdin) } - return ioutil.ReadFile(filename) + return os.ReadFile(filename) } func checkTxValidityPeriodCmdFlags(cmd *cobra.Command) { diff --git a/cmd/goal/multisig.go b/cmd/goal/multisig.go index 905ae035ca..643b335d0e 100644 --- a/cmd/goal/multisig.go +++ b/cmd/goal/multisig.go @@ -19,7 +19,6 @@ package main import ( "fmt" "io" - "io/ioutil" "os" "github.com/spf13/cobra" @@ -240,7 +239,7 @@ var mergeSigCmd = &cobra.Command{ var txnLists [][]transactions.SignedTxn for _, arg := range args { - data, err := ioutil.ReadFile(arg) + data, err := os.ReadFile(arg) if err != nil { reportErrorf(fileReadError, arg, err) } diff --git a/cmd/goal/node.go b/cmd/goal/node.go index 1624603e34..68654055aa 100644 --- a/cmd/goal/node.go +++ b/cmd/goal/node.go @@ -23,7 +23,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "net" "net/http" "os" @@ -131,7 +131,7 @@ func getMissingCatchpointLabel(URL string) (label string, err error) { err = errors.New(resp.Status) return } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return } @@ -648,7 +648,7 @@ var createCmd = &cobra.Command{ } // copy genesis block to destination - err = ioutil.WriteFile(destPath, genesisContent, 0644) + err = os.WriteFile(destPath, genesisContent, 0644) if err != nil { reportErrorf(errorNodeCreation, err) } diff --git a/cmd/goal/tealsign.go b/cmd/goal/tealsign.go index 3d35624a1d..5ff7617d06 100644 --- a/cmd/goal/tealsign.go +++ b/cmd/goal/tealsign.go @@ -19,7 +19,7 @@ package main import ( "encoding/base32" "encoding/base64" - "io/ioutil" + "os" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" @@ -83,7 +83,7 @@ The base64 encoding of the signature will always be printed to stdout. Optionall var kdata []byte var err error if keyFilename != "" { - kdata, err = ioutil.ReadFile(keyFilename) + kdata, err = os.ReadFile(keyFilename) if err != nil { reportErrorf(tealsignKeyfileFail, err) } @@ -123,7 +123,7 @@ The base64 encoding of the signature will always be printed to stdout. Optionall if lsigTxnFilename != "" { // If passed a SignedTxn with a logic sig, compute // the hash of the program within the logic sig - stxnBytes, err := ioutil.ReadFile(lsigTxnFilename) + stxnBytes, err := os.ReadFile(lsigTxnFilename) if err != nil { reportErrorf(fileReadError, lsigTxnFilename, err) } @@ -159,7 +159,7 @@ The base64 encoding of the signature will always be printed to stdout. Optionall var dataToSign []byte if dataFile != "" { - dataToSign, err = ioutil.ReadFile(dataFile) + dataToSign, err = os.ReadFile(dataFile) if err != nil { reportErrorf(tealsignParseData, err) } diff --git a/cmd/loadgenerator/main.go b/cmd/loadgenerator/main.go index 1d28323d88..c657d63299 100644 --- a/cmd/loadgenerator/main.go +++ b/cmd/loadgenerator/main.go @@ -20,7 +20,6 @@ import ( "flag" "fmt" "io/fs" - "io/ioutil" "net/url" "os" "path/filepath" @@ -107,10 +106,10 @@ func main() { if (cfg.ClientURL == nil || cfg.ClientURL.String() == "") || cfg.APIToken == "" { if algodDir != "" { path := filepath.Join(algodDir, "algod.net") - net, err := ioutil.ReadFile(path) + net, err := os.ReadFile(path) maybefail(err, "%s: %v\n", path, err) path = filepath.Join(algodDir, "algod.token") - token, err := ioutil.ReadFile(path) + token, err := os.ReadFile(path) maybefail(err, "%s: %v\n", path, err) cfg.ClientURL, err = url.Parse(fmt.Sprintf("http://%s", string(strings.TrimSpace(string(net))))) maybefail(err, "bad net url %v\n", err) diff --git a/cmd/nodecfg/apply.go b/cmd/nodecfg/apply.go index 70008ff9bc..77e302c7b6 100644 --- a/cmd/nodecfg/apply.go +++ b/cmd/nodecfg/apply.go @@ -18,7 +18,6 @@ package main import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -101,7 +100,7 @@ func doApply(rootDir string, rootNodeDir, channel string, hostName string, dnsNa // If config doesn't already exist, download it to specified root dir if missing { fmt.Fprintf(os.Stdout, "Configuration rootdir not specified - downloading latest version...\n") - rootDir, err = ioutil.TempDir("", channel) + rootDir, err = os.MkdirTemp("", channel) if err != nil { return fmt.Errorf("error creating temp dir for extracting config package: %v", err) } diff --git a/cmd/pingpong/runCmd.go b/cmd/pingpong/runCmd.go index 779ed3f29e..452231f4df 100644 --- a/cmd/pingpong/runCmd.go +++ b/cmd/pingpong/runCmd.go @@ -20,7 +20,6 @@ import ( "context" "encoding/base64" "fmt" - "io/ioutil" "os" "path/filepath" "runtime/pprof" @@ -116,7 +115,7 @@ var runCmd = &cobra.Command{ Long: ``, Run: func(cmd *cobra.Command, args []string) { // Make a cache dir for wallet handle tokens - cacheDir, err := ioutil.TempDir("", "pingpong") + cacheDir, err := os.MkdirTemp("", "pingpong") if err != nil { reportErrorf("Cannot make temp dir: %v\n", err) } @@ -263,7 +262,7 @@ var runCmd = &cobra.Command{ } if logicProg != "" { - cfg.Program, err = ioutil.ReadFile(logicProg) + cfg.Program, err = os.ReadFile(logicProg) if err != nil { reportErrorf("Error opening logic program: %v\n", err) } diff --git a/cmd/tealdbg/localLedger.go b/cmd/tealdbg/localLedger.go index cce2ae75d6..c0a6cd7236 100644 --- a/cmd/tealdbg/localLedger.go +++ b/cmd/tealdbg/localLedger.go @@ -19,7 +19,7 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" + "io" "math/rand" "net/http" @@ -198,7 +198,7 @@ func getAppCreatorFromIndexer(indexerURL string, indexerToken string, app basics } defer resp.Body.Close() if resp.StatusCode != 200 { - msg, _ := ioutil.ReadAll(resp.Body) + msg, _ := io.ReadAll(resp.Body) return basics.Address{}, fmt.Errorf("application response error: %s, status code: %d, request: %s", string(msg), resp.StatusCode, queryString) } var appResp ApplicationIndexerResponse @@ -229,7 +229,7 @@ func getBalanceFromIndexer(indexerURL string, indexerToken string, account basic } defer resp.Body.Close() if resp.StatusCode != 200 { - msg, _ := ioutil.ReadAll(resp.Body) + msg, _ := io.ReadAll(resp.Body) return basics.AccountData{}, fmt.Errorf("account response error: %s, status code: %d, request: %s", string(msg), resp.StatusCode, queryString) } var accountResp AccountIndexerResponse diff --git a/cmd/tealdbg/main.go b/cmd/tealdbg/main.go index 9ab3d3dec0..75e437c149 100644 --- a/cmd/tealdbg/main.go +++ b/cmd/tealdbg/main.go @@ -17,7 +17,6 @@ package main import ( - "io/ioutil" "log" "os" @@ -205,7 +204,7 @@ func debugLocal(args []string) { programNames = make([]string, len(args)) programBlobs = make([][]byte, len(args)) for i, file := range args { - data, err := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { log.Fatalf("Error program reading %s: %s", file, err) } @@ -217,7 +216,7 @@ func debugLocal(args []string) { var err error var txnBlob []byte if len(txnFile) > 0 { - txnBlob, err = ioutil.ReadFile(txnFile) + txnBlob, err = os.ReadFile(txnFile) if err != nil { log.Fatalf("Error txn reading %s: %s", txnFile, err) } @@ -225,7 +224,7 @@ func debugLocal(args []string) { var balanceBlob []byte if len(balanceFile) > 0 { - balanceBlob, err = ioutil.ReadFile(balanceFile) + balanceBlob, err = os.ReadFile(balanceFile) if err != nil { log.Fatalf("Error balance reading %s: %s", balanceFile, err) } @@ -233,7 +232,7 @@ func debugLocal(args []string) { var ddrBlob []byte if len(ddrFile) > 0 { - ddrBlob, err = ioutil.ReadFile(ddrFile) + ddrBlob, err = os.ReadFile(ddrFile) if err != nil { log.Fatalf("Error dryrun-dump reading %s: %s", ddrFile, err) } diff --git a/config/config_test.go b/config/config_test.go index c11edd3797..6c81d36d77 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -20,7 +20,6 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" "reflect" @@ -245,7 +244,7 @@ func TestConfigExampleIsCorrect(t *testing.T) { // see their default (zero) values and instead see the // new default because they won't exist in the old file. func loadWithoutDefaults(cfg Local) (Local, error) { - file, err := ioutil.TempFile("", "lwd") + file, err := os.CreateTemp("", "lwd") if err != nil { return Local{}, err } diff --git a/config/consensus.go b/config/consensus.go index af0b50e53c..0eca1e9f07 100644 --- a/config/consensus.go +++ b/config/consensus.go @@ -18,7 +18,6 @@ package config import ( "encoding/json" - "io/ioutil" "os" "path/filepath" "time" @@ -595,7 +594,7 @@ func SaveConfigurableConsensus(dataDirectory string, params ConsensusProtocols) if err != nil { return err } - err = ioutil.WriteFile(consensusProtocolPath, encodedConsensusParams, 0644) + err = os.WriteFile(consensusProtocolPath, encodedConsensusParams, 0644) return err } diff --git a/config/defaultsGenerator/defaultsGenerator.go b/config/defaultsGenerator/defaultsGenerator.go index 47b5ac51e7..4ee4a1671a 100644 --- a/config/defaultsGenerator/defaultsGenerator.go +++ b/config/defaultsGenerator/defaultsGenerator.go @@ -19,7 +19,6 @@ package main import ( "flag" "fmt" - "io/ioutil" "os" "path/filepath" "reflect" @@ -56,7 +55,7 @@ func main() { printExit("one or more of the required input arguments was not provided\n") } - localDefaultsBytes, err := ioutil.ReadFile(*headerFileName) + localDefaultsBytes, err := os.ReadFile(*headerFileName) if err != nil { printExit("Unable to load file %s : %v", *headerFileName, err) } @@ -70,14 +69,14 @@ func main() { localDefaultsBytes = append(localDefaultsBytes, autoDefaultsBytes...) - err = ioutil.WriteFile(*outputfilename, localDefaultsBytes, 0644) + err = os.WriteFile(*outputfilename, localDefaultsBytes, 0644) if err != nil { printExit("Unable to write file %s : %v", *outputfilename, err) } // generate an update json for the example as well. autoDefaultsBytes = []byte(prettyPrint(config.AutogenLocal, "json")) - err = ioutil.WriteFile(*jsonExampleFileName, autoDefaultsBytes, 0644) + err = os.WriteFile(*jsonExampleFileName, autoDefaultsBytes, 0644) if err != nil { printExit("Unable to write file %s : %v", *jsonExampleFileName, err) } diff --git a/daemon/algod/api/client/restClient.go b/daemon/algod/api/client/restClient.go index b5c3097565..b5d25816d1 100644 --- a/daemon/algod/api/client/restClient.go +++ b/daemon/algod/api/client/restClient.go @@ -23,7 +23,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strings" @@ -135,7 +134,7 @@ func extractError(resp *http.Response) error { return nil } - errorBuf, _ := ioutil.ReadAll(resp.Body) // ignore returned error + errorBuf, _ := io.ReadAll(resp.Body) // ignore returned error errorString := filterASCII(string(errorBuf)) if resp.StatusCode == http.StatusUnauthorized { @@ -221,7 +220,7 @@ func (client RestClient) submitForm(response interface{}, path string, request i return fmt.Errorf("can only decode raw response into type implementing v1.RawResponse") } - bodyBytes, err := ioutil.ReadAll(resp.Body) + bodyBytes, err := io.ReadAll(resp.Body) if err != nil { return err } @@ -638,7 +637,7 @@ func (client RestClient) doGetWithQuery(ctx context.Context, path string, queryA return } - bytes, err := ioutil.ReadAll(resp.Body) + bytes, err := io.ReadAll(resp.Body) if err != nil { return } diff --git a/daemon/algod/server.go b/daemon/algod/server.go index c423e8de2d..4f1ce35158 100644 --- a/daemon/algod/server.go +++ b/daemon/algod/server.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net" "net/http" _ "net/http/pprof" // net/http/pprof is for registering the pprof URLs with the web server, so http://localhost:8080/debug/pprof/ works. @@ -264,13 +263,25 @@ func (s *Server) Start() { // quit earlier than these service files get created s.pidFile = filepath.Join(s.RootPath, "algod.pid") s.netFile = filepath.Join(s.RootPath, "algod.net") - ioutil.WriteFile(s.pidFile, []byte(fmt.Sprintf("%d\n", os.Getpid())), 0644) - ioutil.WriteFile(s.netFile, []byte(fmt.Sprintf("%s\n", addr)), 0644) + err = os.WriteFile(s.pidFile, []byte(fmt.Sprintf("%d\n", os.Getpid())), 0644) + if err != nil { + fmt.Printf("pidfile error: %v\n", err) + os.Exit(1) + } + err = os.WriteFile(s.netFile, []byte(fmt.Sprintf("%s\n", addr)), 0644) + if err != nil { + fmt.Printf("netfile error: %v\n", err) + os.Exit(1) + } listenAddr, listening := s.node.ListeningAddress() if listening { s.netListenFile = filepath.Join(s.RootPath, "algod-listen.net") - ioutil.WriteFile(s.netListenFile, []byte(fmt.Sprintf("%s\n", listenAddr)), 0644) + err = os.WriteFile(s.netListenFile, []byte(fmt.Sprintf("%s\n", listenAddr)), 0644) + if err != nil { + fmt.Printf("netlistenfile error: %v\n", err) + os.Exit(1) + } } errChan := make(chan error, 1) diff --git a/daemon/kmd/config/config.go b/daemon/kmd/config/config.go index 9b932d2162..95a03fe0d7 100644 --- a/daemon/kmd/config/config.go +++ b/daemon/kmd/config/config.go @@ -18,7 +18,7 @@ package config import ( "encoding/json" - "io/ioutil" + "os" "path/filepath" "github.com/algorand/go-algorand/util/codecs" @@ -103,7 +103,7 @@ func (k KMDConfig) Validate() error { func LoadKMDConfig(dataDir string) (cfg KMDConfig, err error) { cfg = defaultConfig(dataDir) configFilename := filepath.Join(dataDir, kmdConfigFilename) - dat, err := ioutil.ReadFile(configFilename) + dat, err := os.ReadFile(configFilename) // If there is no config file, then return the default configuration, and dump the default config to disk if err != nil { exampleFilename := filepath.Join(dataDir, kmdConfigExampleFilename) diff --git a/daemon/kmd/server/server.go b/daemon/kmd/server/server.go index 973df186b3..b36c2859c3 100644 --- a/daemon/kmd/server/server.go +++ b/daemon/kmd/server/server.go @@ -19,7 +19,6 @@ package server import ( "context" "fmt" - "io/ioutil" "net" "net/http" "os" @@ -144,12 +143,12 @@ func (ws *WalletServer) releaseFileLock() error { // Write out a file containing the address kmd is listening on func (ws *WalletServer) writeStateFiles(netAddr string) (err error) { // netPath file contains path to sock file - err = ioutil.WriteFile(ws.netPath, []byte(netAddr), 0640) + err = os.WriteFile(ws.netPath, []byte(netAddr), 0640) if err != nil { return } // pidPath file contains current process ID - err = ioutil.WriteFile(ws.pidPath, []byte(fmt.Sprintf("%d", os.Getpid())), 0640) + err = os.WriteFile(ws.pidPath, []byte(fmt.Sprintf("%d", os.Getpid())), 0640) return } diff --git a/daemon/kmd/wallet/driver/sqlite.go b/daemon/kmd/wallet/driver/sqlite.go index eb78f4a77b..8ad659c282 100644 --- a/daemon/kmd/wallet/driver/sqlite.go +++ b/daemon/kmd/wallet/driver/sqlite.go @@ -20,7 +20,6 @@ import ( "bytes" "crypto/subtle" "fmt" - "io/ioutil" "os" "path/filepath" "regexp" @@ -231,7 +230,7 @@ func walletMetadataFromDBPath(dbPath string) (metadata wallet.Metadata, err erro func (swd *SQLiteWalletDriver) potentialWalletPaths() (paths []string, err error) { // List all files and folders in the wallets directory wDir := swd.walletsDir() - files, err := ioutil.ReadDir(wDir) + files, err := os.ReadDir(wDir) if err != nil { return } diff --git a/data/account/registeryDbOps.go b/data/account/registeryDbOps.go index 6fa69bb153..282008eb76 100644 --- a/data/account/registeryDbOps.go +++ b/data/account/registeryDbOps.go @@ -21,9 +21,10 @@ import ( "database/sql" "errors" "fmt" + "strings" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "strings" ) type dbOp interface { @@ -168,11 +169,7 @@ func (i *insertOp) apply(db *participationDB) (err error) { // Create Rolling entry result, err = tx.Exec(insertRollingQuery, pk, rawVoting) - if err = verifyExecWithOneRowEffected(err, result, "insert rolling"); err != nil { - return err - } - - return nil + return verifyExecWithOneRowEffected(err, result, "insert rolling") }) return err } diff --git a/data/bookkeeping/genesis.go b/data/bookkeeping/genesis.go index 114bb37f8c..7f01519e84 100644 --- a/data/bookkeeping/genesis.go +++ b/data/bookkeeping/genesis.go @@ -18,7 +18,7 @@ package bookkeeping import ( "fmt" - "io/ioutil" + "os" "time" "github.com/algorand/go-algorand/config" @@ -86,7 +86,7 @@ type Genesis struct { // LoadGenesisFromFile attempts to load a Genesis structure from a (presumably) genesis.json file. func LoadGenesisFromFile(genesisFile string) (genesis Genesis, err error) { // Load genesis.json - genesisText, err := ioutil.ReadFile(genesisFile) + genesisText, err := os.ReadFile(genesisFile) if err != nil { return } diff --git a/data/transactions/verify/txn.go b/data/transactions/verify/txn.go index 1d947d31ae..885d0882ec 100644 --- a/data/transactions/verify/txn.go +++ b/data/transactions/verify/txn.go @@ -112,10 +112,7 @@ func Txn(s *transactions.SignedTxn, txnIdx int, groupCtx *GroupContext) error { if batchVerifier.GetNumberOfEnqueuedSignatures() == 0 { return nil } - if err := batchVerifier.Verify(); err != nil { - return err - } - return nil + return batchVerifier.Verify() } // TxnBatchVerify verifies a SignedTxn having no obviously inconsistent data. @@ -258,10 +255,7 @@ func LogicSigSanityCheck(txn *transactions.SignedTxn, groupIndex int, groupCtx * return nil } - if err := batchVerifier.Verify(); err != nil { - return err - } - return nil + return batchVerifier.Verify() } // LogicSigSanityCheckBatchVerify checks that the signature is valid and that the program is basically well formed. diff --git a/gen/generate.go b/gen/generate.go index 804e893c23..15eb091032 100644 --- a/gen/generate.go +++ b/gen/generate.go @@ -19,7 +19,6 @@ package gen import ( "fmt" "io" - "io/ioutil" "math" "os" "path/filepath" @@ -374,7 +373,7 @@ func generateGenesisFiles(outDir string, protoVersion protocol.ConsensusVersion, } jsonData := protocol.EncodeJSON(g) - err = ioutil.WriteFile(filepath.Join(outDir, config.GenesisJSONFile), append(jsonData, '\n'), 0666) + err = os.WriteFile(filepath.Join(outDir, config.GenesisJSONFile), append(jsonData, '\n'), 0666) if (verbose) && (rootKeyCreated > 0 || partKeyCreated > 0) { fmt.Printf("Created %d new rootkeys and %d new partkeys in %s.\n", rootKeyCreated, partKeyCreated, time.Since(createStart)) diff --git a/ledger/acctupdates_test.go b/ledger/acctupdates_test.go index 740ac91d03..da9edd0acc 100644 --- a/ledger/acctupdates_test.go +++ b/ledger/acctupdates_test.go @@ -22,7 +22,6 @@ import ( "database/sql" "errors" "fmt" - "io/ioutil" "os" "runtime" "strings" @@ -138,9 +137,9 @@ func (ml *mockLedgerForTracker) fork(t testing.TB) *mockLedgerForTracker { ml.dbs.Wdb.Vacuum(context.Background()) // copy the database files. for _, ext := range []string{"", "-shm", "-wal"} { - bytes, err := ioutil.ReadFile(ml.filename + ext) + bytes, err := os.ReadFile(ml.filename + ext) require.NoError(t, err) - err = ioutil.WriteFile(newLedgerTracker.filename+ext, bytes, 0600) + err = os.WriteFile(newLedgerTracker.filename+ext, bytes, 0600) require.NoError(t, err) } dbs, err := db.OpenPair(newLedgerTracker.filename, false) diff --git a/ledger/catchpointtracker_test.go b/ledger/catchpointtracker_test.go index 2d7bebcd5e..a12e6fa9ad 100644 --- a/ledger/catchpointtracker_test.go +++ b/ledger/catchpointtracker_test.go @@ -21,7 +21,6 @@ import ( "database/sql" "errors" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -102,7 +101,7 @@ func TestGetCatchpointStream(t *testing.T) { for i := 0; i < filesToCreate; i++ { fileName := filepath.Join(CatchpointDirName, fmt.Sprintf("%d.catchpoint", i)) data := []byte{byte(i), byte(i + 1), byte(i + 2)} - err = ioutil.WriteFile(filepath.Join(temporaryDirectory, fileName), data, 0666) + err = os.WriteFile(filepath.Join(temporaryDirectory, fileName), data, 0666) require.NoError(t, err) // Store the catchpoint into the database diff --git a/ledger/catchpointwriter_test.go b/ledger/catchpointwriter_test.go index fa1819d972..59dd0b72eb 100644 --- a/ledger/catchpointwriter_test.go +++ b/ledger/catchpointwriter_test.go @@ -24,7 +24,7 @@ import ( "database/sql" "fmt" "io" - "io/ioutil" + "os" "path/filepath" "runtime" "testing" @@ -235,7 +235,7 @@ func TestBasicCatchpointWriter(t *testing.T) { require.NoError(t, err) // load the file from disk. - fileContent, err := ioutil.ReadFile(fileName) + fileContent, err := os.ReadFile(fileName) require.NoError(t, err) compressorReader, err := catchpointStage1Decoder(bytes.NewBuffer(fileContent)) require.NoError(t, err) @@ -358,7 +358,7 @@ func TestFullCatchpointWriter(t *testing.T) { require.NoError(t, err) // load the file from disk. - fileContent, err := ioutil.ReadFile(catchpointFilePath) + fileContent, err := os.ReadFile(catchpointFilePath) require.NoError(t, err) gzipReader, err := gzip.NewReader(bytes.NewBuffer(fileContent)) require.NoError(t, err) diff --git a/libgoal/libgoal.go b/libgoal/libgoal.go index b19d379a31..e0910e1758 100644 --- a/libgoal/libgoal.go +++ b/libgoal/libgoal.go @@ -20,7 +20,6 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" "path/filepath" "time" @@ -968,7 +967,7 @@ func (c *Client) VerifyParticipationKey(timeout time.Duration, participationID s // AddParticipationKey takes a participation key file and sends it to the node. // The key will be loaded into the system when the function returns successfully. func (c *Client) AddParticipationKey(keyfile string) (resp generated.PostParticipationResponse, err error) { - data, err := ioutil.ReadFile(keyfile) + data, err := os.ReadFile(keyfile) if err != nil { return } diff --git a/libgoal/lockedFile.go b/libgoal/lockedFile.go index 3c827d870d..26b235d243 100644 --- a/libgoal/lockedFile.go +++ b/libgoal/lockedFile.go @@ -18,7 +18,7 @@ package libgoal import ( "fmt" - "io/ioutil" + "io" "os" ) @@ -72,7 +72,7 @@ func (f *lockedFile) read() (bytes []byte, err error) { } }() - bytes, err = ioutil.ReadAll(fd) + bytes, err = io.ReadAll(fd) return } diff --git a/logging/cyclicWriter_test.go b/logging/cyclicWriter_test.go index d1eaa43b0b..5719be9303 100644 --- a/logging/cyclicWriter_test.go +++ b/logging/cyclicWriter_test.go @@ -17,7 +17,6 @@ package logging import ( - "io/ioutil" "os" "testing" @@ -49,12 +48,12 @@ func TestCyclicWrite(t *testing.T) { require.NoError(t, err) require.Equal(t, len(secondWrite), n) - liveData, err := ioutil.ReadFile(liveFileName) + liveData, err := os.ReadFile(liveFileName) require.NoError(t, err) require.Len(t, liveData, len(secondWrite)) require.Equal(t, byte('B'), liveData[0]) - oldData, err := ioutil.ReadFile(archiveFileName) + oldData, err := os.ReadFile(archiveFileName) require.NoError(t, err) require.Len(t, oldData, space) for i := 0; i < space; i++ { diff --git a/netdeploy/network.go b/netdeploy/network.go index f54eef4ccb..78a665b789 100644 --- a/netdeploy/network.go +++ b/netdeploy/network.go @@ -19,7 +19,6 @@ package netdeploy import ( "encoding/json" "fmt" - "io/ioutil" "os" "path/filepath" "sort" @@ -233,7 +232,7 @@ func saveNetworkCfg(cfg NetworkCfg, configFile string) error { func (n *Network) scanForNodes() error { // Enumerate direct sub-directories of our root and look for valid node data directories (where genesis.json exists) - entries, err := ioutil.ReadDir(n.rootDir) + entries, err := os.ReadDir(n.rootDir) if err != nil { return err } diff --git a/netdeploy/networkTemplate.go b/netdeploy/networkTemplate.go index 293fbaa865..5456179287 100644 --- a/netdeploy/networkTemplate.go +++ b/netdeploy/networkTemplate.go @@ -20,7 +20,7 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" + "io/fs" "math/big" "os" "path/filepath" @@ -107,8 +107,8 @@ func (t NetworkTemplate) createNodeDirectories(targetFolder string, binDir strin return } - var files []os.FileInfo - files, err = ioutil.ReadDir(targetFolder) + var files []fs.DirEntry + files, err = os.ReadDir(targetFolder) if err != nil { return } diff --git a/netdeploy/remote/deployedNetwork.go b/netdeploy/remote/deployedNetwork.go index 3382edee04..23828d469a 100644 --- a/netdeploy/remote/deployedNetwork.go +++ b/netdeploy/remote/deployedNetwork.go @@ -19,7 +19,7 @@ package remote import ( "encoding/json" "fmt" - "io/ioutil" + "io/fs" "math/rand" "os" "path/filepath" @@ -128,7 +128,7 @@ func InitDeployedNetworkConfig(file string, buildConfig BuildConfig) (cfg Deploy } func loadAndProcessConfig(file string, buildConfig BuildConfig) (expanded string, err error) { - raw, err := ioutil.ReadFile(file) + raw, err := os.ReadFile(file) if err != nil { return } @@ -287,7 +287,7 @@ func validateFilename(filename string) (err error) { if strings.Index(filename, "*") >= 0 { return ErrDeployedNetworkNameCantIncludeWildcard } - file, err := ioutil.TempFile("", filename) + file, err := os.CreateTemp("", filename) if err == nil { file.Close() os.Remove(file.Name()) @@ -831,8 +831,8 @@ func (cfg DeployedNetwork) createHostFolders(targetFolder string, genesisFolder } func (cfg DeployedNetwork) copyWalletsToNodes(genesisFolder string, walletNameToDataMap map[string]walletTargetData) (err error) { - var files []os.FileInfo - files, err = ioutil.ReadDir(genesisFolder) + var files []fs.DirEntry + files, err = os.ReadDir(genesisFolder) if err != nil { return } diff --git a/netdeploy/remote/nodecfg/nodeDir.go b/netdeploy/remote/nodecfg/nodeDir.go index a59b15c3a7..1136875457 100644 --- a/netdeploy/remote/nodecfg/nodeDir.go +++ b/netdeploy/remote/nodecfg/nodeDir.go @@ -19,7 +19,6 @@ package nodecfg import ( "encoding/json" "fmt" - "io/ioutil" "net/url" "os" "path/filepath" @@ -174,9 +173,11 @@ func (nd *nodeDir) configureAPIToken(token string) (err error) { return } fmt.Fprintf(os.Stdout, " - Assigning APIToken: %s\n", token) - ioutil.WriteFile(filepath.Join(nd.dataDir, tokens.AlgodTokenFilename), []byte(token), 0600) - err = nd.saveConfig() - return + err = os.WriteFile(filepath.Join(nd.dataDir, tokens.AlgodTokenFilename), []byte(token), 0600) + if err != nil { + return err + } + return nd.saveConfig() } func (nd *nodeDir) configureTelemetry(enable bool) (err error) { diff --git a/network/limitlistener/rejectingLimitListener_test.go b/network/limitlistener/rejectingLimitListener_test.go index 7f286e13de..a3b955fc5e 100644 --- a/network/limitlistener/rejectingLimitListener_test.go +++ b/network/limitlistener/rejectingLimitListener_test.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net" "net/http" "testing" @@ -57,7 +56,7 @@ func TestRejectingLimitListenerBasic(t *testing.T) { return } - io.Copy(ioutil.Discard, r.Body) + io.Copy(io.Discard, r.Body) r.Body.Close() queryCh <- nil diff --git a/network/wsNetwork.go b/network/wsNetwork.go index 86f110553f..b7b2a5e893 100644 --- a/network/wsNetwork.go +++ b/network/wsNetwork.go @@ -22,7 +22,7 @@ import ( "encoding/base64" "errors" "fmt" - "io/ioutil" + "io" "net" "net/http" "net/textproto" @@ -2031,7 +2031,7 @@ func (wn *WebsocketNetwork) tryConnect(addr, gossipAddr string) { if err == websocket.ErrBadHandshake { // reading here from ioutil is safe only because it came from DialContext above, which alredy finsihed reading all the data from the network // and placed it all in a ioutil.NopCloser reader. - bodyBytes, _ := ioutil.ReadAll(response.Body) + bodyBytes, _ := io.ReadAll(response.Body) errString := string(bodyBytes) if len(errString) > 128 { errString = errString[:128] diff --git a/node/node.go b/node/node.go index 7f0df81400..97f5c3f0d8 100644 --- a/node/node.go +++ b/node/node.go @@ -21,7 +21,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -900,7 +899,7 @@ func (node *AlgorandFullNode) InstallParticipationKey(partKeyBinary []byte) (acc func (node *AlgorandFullNode) loadParticipationKeys() error { // Generate a list of all potential participation key files genesisDir := filepath.Join(node.rootDir, node.genesisID) - files, err := ioutil.ReadDir(genesisDir) + files, err := os.ReadDir(genesisDir) if err != nil { return fmt.Errorf("AlgorandFullNode.loadPartitipationKeys: could not read directory %v: %v", genesisDir, err) } diff --git a/nodecontrol/algodControl.go b/nodecontrol/algodControl.go index 872fa05a45..e614cf63fb 100644 --- a/nodecontrol/algodControl.go +++ b/nodecontrol/algodControl.go @@ -18,7 +18,6 @@ package nodecontrol import ( "fmt" - "io/ioutil" "net/url" "os" "os/exec" @@ -368,7 +367,7 @@ func (nc NodeController) GetGenesis() (bookkeeping.Genesis, error) { var genesis bookkeeping.Genesis genesisFile := filepath.Join(nc.GetDataDir(), config.GenesisJSONFile) - genesisText, err := ioutil.ReadFile(genesisFile) + genesisText, err := os.ReadFile(genesisFile) if err != nil { return genesis, err } @@ -417,7 +416,7 @@ func (nc NodeController) setAlgodCmdLogFiles(cmd *exec.Cmd) (files []*os.File) { func (nc NodeController) readGenesisJSON(genesisFile string) (genesisLedger bookkeeping.Genesis, err error) { // Load genesis - genesisText, err := ioutil.ReadFile(genesisFile) + genesisText, err := os.ReadFile(genesisFile) if err != nil { return } diff --git a/protocol/codec_tester.go b/protocol/codec_tester.go index 3f441c3c96..f402700391 100644 --- a/protocol/codec_tester.go +++ b/protocol/codec_tester.go @@ -18,7 +18,6 @@ package protocol import ( "fmt" - "io/ioutil" "math/rand" "os" "path" @@ -146,7 +145,7 @@ func checkMsgpAllocBoundDirective(dataType reflect.Type) bool { return nil }) for _, packageFile := range packageFiles { - fileBytes, err := ioutil.ReadFile(packageFile) + fileBytes, err := os.ReadFile(packageFile) if err != nil { continue } @@ -363,7 +362,11 @@ func EncodingTest(template msgpMarshalUnmarshal) error { } if debugCodecTester { - ioutil.WriteFile("/tmp/v0", []byte(fmt.Sprintf("%#v", v0)), 0666) + err = os.WriteFile("/tmp/v0", []byte(fmt.Sprintf("%#v", v0)), 0666) + if err != nil { + return err + } + } e1 := EncodeMsgp(v0.(msgp.Marshaler)) @@ -371,8 +374,14 @@ func EncodingTest(template msgpMarshalUnmarshal) error { // for debug, write out the encodings to a file if debugCodecTester { - ioutil.WriteFile("/tmp/e1", e1, 0666) - ioutil.WriteFile("/tmp/e2", e2, 0666) + err = os.WriteFile("/tmp/e1", e1, 0666) + if err != nil { + return err + } + err = os.WriteFile("/tmp/e2", e2, 0666) + if err != nil { + return err + } } if !reflect.DeepEqual(e1, e2) { @@ -393,8 +402,14 @@ func EncodingTest(template msgpMarshalUnmarshal) error { } if debugCodecTester { - ioutil.WriteFile("/tmp/v1", []byte(fmt.Sprintf("%#v", v1)), 0666) - ioutil.WriteFile("/tmp/v2", []byte(fmt.Sprintf("%#v", v2)), 0666) + err = os.WriteFile("/tmp/v1", []byte(fmt.Sprintf("%#v", v1)), 0666) + if err != nil { + return err + } + err = os.WriteFile("/tmp/v2", []byte(fmt.Sprintf("%#v", v2)), 0666) + if err != nil { + return err + } } // At this point, it might be that v differs from v1 and v2, @@ -413,8 +428,14 @@ func EncodingTest(template msgpMarshalUnmarshal) error { ee2 := EncodeReflect(v1) if debugCodecTester { - ioutil.WriteFile("/tmp/ee1", ee1, 0666) - ioutil.WriteFile("/tmp/ee2", ee2, 0666) + err = os.WriteFile("/tmp/ee1", ee1, 0666) + if err != nil { + return err + } + err = os.WriteFile("/tmp/ee2", ee2, 0666) + if err != nil { + return err + } } if !reflect.DeepEqual(e1, ee1) { diff --git a/protocol/transcode/core_test.go b/protocol/transcode/core_test.go index 132c4270a2..e9cfc42f87 100644 --- a/protocol/transcode/core_test.go +++ b/protocol/transcode/core_test.go @@ -20,7 +20,6 @@ import ( "encoding/base32" "fmt" "io" - "io/ioutil" "testing" "github.com/stretchr/testify/require" @@ -56,7 +55,7 @@ func testIdempotentRoundtrip(t *testing.T, mpdata []byte) { } p1in.Close() }() - res, err := ioutil.ReadAll(p3out) + res, err := io.ReadAll(p3out) require.NoError(t, err) require.Equal(t, mpdata, res) diff --git a/rpcs/blockService_test.go b/rpcs/blockService_test.go index f05c0f6efb..2adb2f1b29 100644 --- a/rpcs/blockService_test.go +++ b/rpcs/blockService_test.go @@ -19,7 +19,7 @@ package rpcs import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "strings" "testing" @@ -173,7 +173,7 @@ func TestRedirectFallbackArchiver(t *testing.T) { require.NoError(t, err) require.Equal(t, http.StatusOK, response.StatusCode) - bodyData, err := ioutil.ReadAll(response.Body) + bodyData, err := io.ReadAll(response.Body) require.NoError(t, err) require.NotEqual(t, 0, len(bodyData)) } diff --git a/shared/pingpong/accounts.go b/shared/pingpong/accounts.go index fa8cfecdf0..b63214fdd2 100644 --- a/shared/pingpong/accounts.go +++ b/shared/pingpong/accounts.go @@ -18,7 +18,6 @@ package pingpong import ( "fmt" - "io/ioutil" "math/rand" "os" "path/filepath" @@ -48,7 +47,7 @@ func (pps *WorkerState) ensureAccounts(ac libgoal.Client, initCfg PpConfig) (acc return } genesisDir := filepath.Join(ac.DataDir(), genID) - files, err2 := ioutil.ReadDir(genesisDir) + files, err2 := os.ReadDir(genesisDir) if err2 != nil { err = err2 return diff --git a/stateproof/worker_test.go b/stateproof/worker_test.go index 4c35c8c693..9145141179 100644 --- a/stateproof/worker_test.go +++ b/stateproof/worker_test.go @@ -21,7 +21,7 @@ import ( "database/sql" "encoding/binary" "fmt" - "io/ioutil" + "io" "strings" "sync" "testing" @@ -573,7 +573,7 @@ func TestSignerDoesntDeleteKeysWhenDBDoesntStoreSigs(t *testing.T) { dbs, _ := dbOpenTest(t, true) logger := logging.NewLogger() - logger.SetOutput(ioutil.Discard) + logger.SetOutput(io.Discard) w := NewWorker(dbs.Wdb, logger, s, s, s, s) diff --git a/test/commandandcontrol/cc_agent/component/pingPongComponent.go b/test/commandandcontrol/cc_agent/component/pingPongComponent.go index 7f992e793b..674c476f91 100644 --- a/test/commandandcontrol/cc_agent/component/pingPongComponent.go +++ b/test/commandandcontrol/cc_agent/component/pingPongComponent.go @@ -20,7 +20,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "os" "time" "github.com/algorand/go-algorand/libgoal" @@ -101,7 +101,7 @@ func (componentInstance *PingPongComponentInstance) Terminate() (err error) { func (componentInstance *PingPongComponentInstance) startPingPong(cfg *pingpong.PpConfig) (err error) { // Make a cache dir for wallet handle tokens - cacheDir, err := ioutil.TempDir(GetHostAgent().TempDir, PINGPONG) + cacheDir, err := os.MkdirTemp(GetHostAgent().TempDir, PINGPONG) if err != nil { log.Errorf("Cannot make temp dir: %v\n", err) return diff --git a/test/commandandcontrol/cc_client/main.go b/test/commandandcontrol/cc_client/main.go index c45fec1b8f..817afb850a 100644 --- a/test/commandandcontrol/cc_client/main.go +++ b/test/commandandcontrol/cc_client/main.go @@ -19,7 +19,6 @@ package main import ( "flag" "fmt" - "io/ioutil" "net/url" "os" "os/signal" @@ -65,7 +64,7 @@ func main() { os.Exit(1) } - options, err := ioutil.ReadFile(*componentOptions) + options, err := os.ReadFile(*componentOptions) if err != nil { log.Errorf("failed to read options file %s", *componentOptions) } diff --git a/test/e2e-go/features/stateproofs/stateproofs_test.go b/test/e2e-go/features/stateproofs/stateproofs_test.go index 8fdcfe31f6..b2500d0a56 100644 --- a/test/e2e-go/features/stateproofs/stateproofs_test.go +++ b/test/e2e-go/features/stateproofs/stateproofs_test.go @@ -18,7 +18,6 @@ package stateproofs import ( "fmt" - "io/ioutil" "os" "path/filepath" "runtime" @@ -633,7 +632,7 @@ func TestUnableToRecoverFromLaggingStateProofChain(t *testing.T) { // installParticipationKey generates a new key for a given account and installs it with the client. func installParticipationKey(t *testing.T, client libgoal.Client, addr string, firstValid, lastValid uint64) (resp generated.PostParticipationResponse, part account.Participation, err error) { - dir, err := ioutil.TempDir("", "temporary_partkey_dir") + dir, err := os.MkdirTemp("", "temporary_partkey_dir") require.NoError(t, err) defer os.RemoveAll(dir) diff --git a/test/framework/fixtures/baseFixture.go b/test/framework/fixtures/baseFixture.go index 37086e5365..a2205d3c63 100644 --- a/test/framework/fixtures/baseFixture.go +++ b/test/framework/fixtures/baseFixture.go @@ -18,7 +18,6 @@ package fixtures import ( "fmt" - "io/ioutil" "os" "path" "runtime" @@ -55,7 +54,7 @@ func (f *baseFixture) initialize(instance Fixture) { } f.testDir = os.Getenv("TESTDIR") if f.testDir == "" { - f.testDir, _ = ioutil.TempDir("", "tmp") + f.testDir, _ = os.MkdirTemp("", "tmp") f.testDirTmp = true } f.testDataDir = os.Getenv("TESTDATADIR") diff --git a/test/framework/fixtures/kmdFixture.go b/test/framework/fixtures/kmdFixture.go index 75a357f2a2..db4794d3d3 100644 --- a/test/framework/fixtures/kmdFixture.go +++ b/test/framework/fixtures/kmdFixture.go @@ -17,7 +17,6 @@ package fixtures import ( - "io/ioutil" "os" "path/filepath" "strings" @@ -133,14 +132,14 @@ func (f *KMDFixture) SetupWithConfig(t TestingTB, config string) { // Write a token f.APIToken = defaultAPIToken tokenFilepath := filepath.Join(f.kmdDir, "kmd.token") - err := ioutil.WriteFile(tokenFilepath, f.APIToken, 0640) + err := os.WriteFile(tokenFilepath, f.APIToken, 0640) require.NoError(f.t, err) if config == "" { config = defaultConfig } configFilepath := filepath.Join(f.kmdDir, "kmd_config.json") - err = ioutil.WriteFile(configFilepath, []byte(config), 0640) + err = os.WriteFile(configFilepath, []byte(config), 0640) require.NoError(f.t, err) // Start kmd @@ -197,7 +196,7 @@ func (f *KMDFixture) MakeWalletAndHandleToken() (handleToken string, err error) func (f *KMDFixture) TestConfig(cfg []byte) error { // Write the passed config configFilepath := filepath.Join(f.kmdDir, "kmd_config.json") - err := ioutil.WriteFile(configFilepath, cfg, 0640) + err := os.WriteFile(configFilepath, cfg, 0640) if err != nil { return err } diff --git a/test/framework/fixtures/libgoalFixture.go b/test/framework/fixtures/libgoalFixture.go index e6ad44e060..746a0c2f94 100644 --- a/test/framework/fixtures/libgoalFixture.go +++ b/test/framework/fixtures/libgoalFixture.go @@ -19,7 +19,6 @@ package fixtures import ( "bufio" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -136,7 +135,7 @@ func (f *LibGoalFixture) importRootKeys(lg *libgoal.Client, dataDir string) { } keyDir := filepath.Join(dataDir, genID) - files, err := ioutil.ReadDir(keyDir) + files, err := os.ReadDir(keyDir) if err != nil { return } diff --git a/test/netperf-go/puppeteer/promMetricFetcher.go b/test/netperf-go/puppeteer/promMetricFetcher.go index 64a3341a03..06e0853c84 100644 --- a/test/netperf-go/puppeteer/promMetricFetcher.go +++ b/test/netperf-go/puppeteer/promMetricFetcher.go @@ -19,7 +19,7 @@ package main import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "reflect" "strconv" @@ -62,7 +62,7 @@ func (r *promMetricFetcher) getMetric(query string) (results []promValueResult, return nil, fmt.Errorf("http error code received %v", resp.StatusCode) } - bytes, err := ioutil.ReadAll(resp.Body) + bytes, err := io.ReadAll(resp.Body) if err != nil { return } diff --git a/test/netperf-go/puppeteer/puppeteer.go b/test/netperf-go/puppeteer/puppeteer.go index bcc870672f..5a5fab11ce 100644 --- a/test/netperf-go/puppeteer/puppeteer.go +++ b/test/netperf-go/puppeteer/puppeteer.go @@ -21,7 +21,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "os/exec" "path" @@ -73,7 +72,7 @@ type puppet struct { } func puppeteer(channel, jsonFile string) error { - jsonBytes, err := ioutil.ReadFile(jsonFile) + jsonBytes, err := os.ReadFile(jsonFile) if err != nil { return err } @@ -367,7 +366,7 @@ func (p *puppet) runStep(recipeStep recipeStep, timeout time.Duration) error { outFile: os.Stdout, } } else { - output = ioutil.Discard + output = io.Discard } cmd.Stderr = &errorOutput diff --git a/tools/debug/doberman/logo.go b/tools/debug/doberman/logo.go index 163b73951c..a274110742 100644 --- a/tools/debug/doberman/logo.go +++ b/tools/debug/doberman/logo.go @@ -16,7 +16,7 @@ package main -// data, err := ioutil.ReadFile("algorand-logo.png") +// data, err := os.ReadFile("algorand-logo.png") // fmt.Printf("%#v\n", data) var logo = []byte{0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0xf0, 0x0, 0x0, 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 0x0, 0x10, 0x1a, 0x0, 0x8, 0xd, 0x0, 0x84, 0x6, 0x0, 0x42, 0x3, 0x8, 0xd, 0x0, 0x84, 0x6, 0x0, 0x42, 0x3, 0x0, 0xa1, 0x1, 0x80, 0xd0, 0x0, 0x42, 0x3, 0x0, 0xa1, 0x1, 0x80, 0xd0, 0x0, 0x40, 0x68, 0x0, 0x20, 0x34, 0x80, 0xd0, 0x0, 0x40, 0x68, 0x0, 0x20, 0x34, 0x0, 0x10, 0x1a, 0x0, 0x8, 0xd, 0x20, 0x34, 0x0, 0x10, 0x1a, 0x0, 0x8, 0xd, 0x0, 0x84, 0x6, 0x10, 0x1a, 0x0, 0x8, 0xd, 0x0, 0x84, 0x6, 0x0, 0x42, 0x3, 0x0, 0xa1, 0x1, 0x84, 0x6, 0x0, 0x42, 0x3, 0x0, 0xa1, 0x1, 0x80, 0xd0, 0x0, 0x40, 0x68, 0x0, 0xa1, 0x1, 0x80, 0xd0, 0x0, 0x40, 0x68, 0x0, 0x20, 0x34, 0x0, 0x10, 0x1a, 0x40, 0x68, 0x0, 0x20, 0x34, 0x0, 0x10, 0x1a, 0x0, 0x8, 0xd, 0x0, 0x84, 0x6, 0xca, 0xe7, 0x7f, 0x1, 0x0, 0x0, 0xff, 0xff, 0x1a, 0xd5, 0xb5, 0x9c, 0xcd, 0x97, 0x3e, 0x9f, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82} diff --git a/tools/debug/doberman/main.go b/tools/debug/doberman/main.go index eb8eb447b9..70899f3c81 100644 --- a/tools/debug/doberman/main.go +++ b/tools/debug/doberman/main.go @@ -23,7 +23,6 @@ import ( "flag" "fmt" "io" - "io/ioutil" "os" "os/exec" "strings" @@ -57,7 +56,7 @@ func main() { } // write logo - tf, err := ioutil.TempFile("", "algorand-logo.png") + tf, err := os.CreateTemp("", "algorand-logo.png") if err != nil { panic(err) } diff --git a/tools/debug/logfilter/main_test.go b/tools/debug/logfilter/main_test.go index 9058f611c8..45ab8605fc 100644 --- a/tools/debug/logfilter/main_test.go +++ b/tools/debug/logfilter/main_test.go @@ -19,7 +19,6 @@ package main import ( "bytes" - "io/ioutil" "os" "path/filepath" "strings" @@ -48,7 +47,7 @@ func TestLogFilterExamples(t *testing.T) { for _, exampleFileName := range exampleFiles { // load the expected result file. expectedOutFile := strings.Replace(exampleFileName, ".in", ".out.expected", 1) - expectedOutBytes, err := ioutil.ReadFile(expectedOutFile) + expectedOutBytes, err := os.ReadFile(expectedOutFile) require.NoError(t, err) expectedErrorCode := 0 if strings.Contains(string(expectedOutBytes), "FAIL") { diff --git a/tools/network/cloudflare/cloudflare.go b/tools/network/cloudflare/cloudflare.go index 414f812323..714fb9635b 100644 --- a/tools/network/cloudflare/cloudflare.go +++ b/tools/network/cloudflare/cloudflare.go @@ -19,7 +19,7 @@ package cloudflare import ( "context" "fmt" - "io/ioutil" + "io" "net/http" "strings" ) @@ -170,7 +170,7 @@ func (d *DNS) CreateDNSRecord(ctx context.Context, recordType string, name strin if !parsedResponse.Success { request, _ := createDNSRecordRequest(d.zoneID, d.authToken, recordType, name, content, ttl, priority, proxied) requestBody, _ := request.GetBody() - bodyBytes, _ := ioutil.ReadAll(requestBody) + bodyBytes, _ := io.ReadAll(requestBody) return fmt.Errorf("failed to create DNS record. Request url = '%v', body = %s, parsed response : %#v, response headers = %#v", request.URL, string(bodyBytes), parsedResponse, response.Header) } return nil @@ -195,7 +195,7 @@ func (d *DNS) CreateSRVRecord(ctx context.Context, name string, target string, t if !parsedResponse.Success { request, _ := createSRVRecordRequest(d.zoneID, d.authToken, name, service, protocol, weight, port, ttl, priority, target) requestBody, _ := request.GetBody() - bodyBytes, _ := ioutil.ReadAll(requestBody) + bodyBytes, _ := io.ReadAll(requestBody) return fmt.Errorf("failed to create SRV record. Request url = '%v', body = %s, parsedResponse = %#v, response headers = %#v", request.URL, string(bodyBytes), parsedResponse, response.Header) } return nil @@ -220,7 +220,7 @@ func (d *DNS) DeleteDNSRecord(ctx context.Context, recordID string) error { if !parsedResponse.Success { request, _ := deleteDNSRecordRequest(d.zoneID, d.authToken, recordID) requestBody, _ := request.GetBody() - bodyBytes, _ := ioutil.ReadAll(requestBody) + bodyBytes, _ := io.ReadAll(requestBody) return fmt.Errorf("failed to delete DNS record. Request url = '%v', body = %s, parsedResponse = %#v, response headers = %#v", request.URL, string(bodyBytes), parsedResponse, response.Header) } return nil @@ -246,7 +246,7 @@ func (d *DNS) UpdateDNSRecord(ctx context.Context, recordID string, recordType s if !parsedResponse.Success { request, _ := updateDNSRecordRequest(d.zoneID, d.authToken, recordID, recordType, name, content, ttl, priority, proxied) requestBody, _ := request.GetBody() - bodyBytes, _ := ioutil.ReadAll(requestBody) + bodyBytes, _ := io.ReadAll(requestBody) return fmt.Errorf("failed to update DNS record. Request url = '%v', body = %s, parsedResponse = %#v, response headers = %#v", request.URL, string(bodyBytes), parsedResponse, response.Header) } @@ -272,7 +272,7 @@ func (d *DNS) UpdateSRVRecord(ctx context.Context, recordID string, name string, if !parsedResponse.Success { request, _ := updateSRVRecordRequest(d.zoneID, d.authToken, recordID, name, service, protocol, weight, port, ttl, priority, target) requestBody, _ := request.GetBody() - bodyBytes, _ := ioutil.ReadAll(requestBody) + bodyBytes, _ := io.ReadAll(requestBody) return fmt.Errorf("failed to update SRV record. Request url = '%v', body = %s, parsedResponse = %#v, response headers = %#v", request.URL, string(bodyBytes), parsedResponse, response.Header) } return nil @@ -303,7 +303,7 @@ func (c *Cred) GetZones(ctx context.Context) (zones []Zone, err error) { if !parsedResponse.Success { request, _ := getZonesRequest(c.authToken) requestBody, _ := request.GetBody() - bodyBytes, _ := ioutil.ReadAll(requestBody) + bodyBytes, _ := io.ReadAll(requestBody) return nil, fmt.Errorf("failed to retrieve zone records. Request url = '%v', body = %s, parsedResponse = %#v, response headers = %#v", request.URL, string(bodyBytes), parsedResponse, response.Header) } @@ -360,7 +360,7 @@ func (d *DNS) ExportZone(ctx context.Context) (exportedZoneBytes []byte, err err return nil, err } defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) + body, err := io.ReadAll(response.Body) if err != nil { return nil, err } diff --git a/tools/network/cloudflare/createRecord.go b/tools/network/cloudflare/createRecord.go index 747dc57ae1..c68747f5bd 100644 --- a/tools/network/cloudflare/createRecord.go +++ b/tools/network/cloudflare/createRecord.go @@ -20,7 +20,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -144,7 +144,7 @@ type CreateDNSRecordResult struct { // parseCreateDNSRecordResponse parses the response that was received as a result of a ListDNSRecordRequest func parseCreateDNSRecordResponse(response *http.Response) (*CreateDNSRecordResponse, error) { defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) + body, err := io.ReadAll(response.Body) if err != nil { return nil, err } diff --git a/tools/network/cloudflare/deleteRecord.go b/tools/network/cloudflare/deleteRecord.go index 9770be8988..f0bf90ce5c 100644 --- a/tools/network/cloudflare/deleteRecord.go +++ b/tools/network/cloudflare/deleteRecord.go @@ -19,7 +19,7 @@ package cloudflare import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -55,7 +55,7 @@ type DeleteDNSRecordResult struct { // ParseDeleteDNSRecordResponse parses the response that was received as a result of a ListDNSRecordRequest func parseDeleteDNSRecordResponse(response *http.Response) (*DeleteDNSRecordResponse, error) { defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) + body, err := io.ReadAll(response.Body) if err != nil { return nil, err } diff --git a/tools/network/cloudflare/listRecords.go b/tools/network/cloudflare/listRecords.go index 263e8adf8d..1617b61188 100644 --- a/tools/network/cloudflare/listRecords.go +++ b/tools/network/cloudflare/listRecords.go @@ -19,7 +19,7 @@ package cloudflare import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -120,7 +120,7 @@ type DNSRecordResponseEntry struct { // parseListDNSRecordResponse parses the response that was received as a result of a ListDNSRecordRequest func parseListDNSRecordResponse(response *http.Response) (*ListDNSRecordResponse, error) { defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) + body, err := io.ReadAll(response.Body) if err != nil { return nil, err } diff --git a/tools/network/cloudflare/zones.go b/tools/network/cloudflare/zones.go index d73829ea5f..f5aa4b9ac2 100644 --- a/tools/network/cloudflare/zones.go +++ b/tools/network/cloudflare/zones.go @@ -19,7 +19,7 @@ package cloudflare import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" ) @@ -71,7 +71,7 @@ type GetZonesResultItem struct { func parseGetZonesResponse(response *http.Response) (*GetZonesResult, error) { defer response.Body.Close() - body, err := ioutil.ReadAll(response.Body) + body, err := io.ReadAll(response.Body) if err != nil { return nil, err } diff --git a/tools/teal/algotmpl/main.go b/tools/teal/algotmpl/main.go index 2d24841a57..7568dda92f 100644 --- a/tools/teal/algotmpl/main.go +++ b/tools/teal/algotmpl/main.go @@ -20,7 +20,6 @@ package main import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -107,7 +106,7 @@ type param struct { } func initCommandsFromDir(dirname string) error { - files, err := ioutil.ReadDir(dirname) + files, err := os.ReadDir(dirname) if err != nil { return err } @@ -137,7 +136,7 @@ func initCommandsFromDir(dirname string) error { if err != nil { return err } - data, err := ioutil.ReadFile(fullpath) + data, err := os.ReadFile(fullpath) if err != nil { return err } diff --git a/tools/teal/dkey/dsign/main.go b/tools/teal/dkey/dsign/main.go index ff8a6067bb..6f380d8a0b 100644 --- a/tools/teal/dkey/dsign/main.go +++ b/tools/teal/dkey/dsign/main.go @@ -23,7 +23,7 @@ package main import ( "encoding/base64" "fmt" - "io/ioutil" + "io" "os" "github.com/algorand/go-algorand/crypto" @@ -47,7 +47,7 @@ func main() { keyfname := os.Args[1] lsigfname := os.Args[2] - kdata, err := ioutil.ReadFile(keyfname) + kdata, err := os.ReadFile(keyfname) failFast(err) var seed crypto.Seed copy(seed[:], kdata) @@ -56,10 +56,10 @@ func main() { if len(os.Args) == 4 { // In this mode, interpret lsig-file as raw program bytes and produce a signature // over the data file - pdata, err := ioutil.ReadFile(lsigfname) + pdata, err := os.ReadFile(lsigfname) failFast(err) - ddata, err := ioutil.ReadFile(os.Args[3]) + ddata, err := os.ReadFile(os.Args[3]) failFast(err) dsig := sec.Sign(logic.Msg{ @@ -71,13 +71,13 @@ func main() { } else { // In this mode, interpret lsig-file as a LogicSig struct and sign the // txid of the transaction passed over stdin - pdata, err := ioutil.ReadFile(lsigfname) + pdata, err := os.ReadFile(lsigfname) failFast(err) var lsig transactions.LogicSig err = protocol.Decode(pdata, &lsig) failFast(err) - txdata, err := ioutil.ReadAll(os.Stdin) + txdata, err := io.ReadAll(os.Stdin) failFast(err) var txn transactions.SignedTxn err = protocol.Decode(txdata, &txn) diff --git a/tools/teal/tealcut/main.go b/tools/teal/tealcut/main.go index 96958c42af..7615cdc979 100644 --- a/tools/teal/tealcut/main.go +++ b/tools/teal/tealcut/main.go @@ -22,7 +22,6 @@ import ( "encoding/binary" "encoding/hex" "fmt" - "io/ioutil" "os" "strconv" "strings" @@ -56,7 +55,7 @@ func main() { } var splitbytes [8]byte binary.BigEndian.PutUint64(splitbytes[:], splitnum) - data, err := ioutil.ReadFile(os.Args[1]) + data, err := os.ReadFile(os.Args[1]) if err != nil { panic(err) } diff --git a/util/codecs/json.go b/util/codecs/json.go index 071c2f30c6..2d2c21134e 100644 --- a/util/codecs/json.go +++ b/util/codecs/json.go @@ -21,7 +21,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "reflect" "strings" @@ -79,7 +78,7 @@ func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface // When done, ensure last value line doesn't include comma // Write string array to file. - file, err := ioutil.TempFile("", "encsndv") + file, err := os.CreateTemp("", "encsndv") if err != nil { return err } @@ -94,7 +93,7 @@ func SaveNonDefaultValuesToFile(filename string, object, defaultObject interface } // Read lines from encoded file into string array - content, err := ioutil.ReadFile(name) + content, err := os.ReadFile(name) if err != nil { return err } diff --git a/util/io.go b/util/io.go index 081c1d5681..43068f39c9 100644 --- a/util/io.go +++ b/util/io.go @@ -19,7 +19,6 @@ package util import ( "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -83,7 +82,7 @@ func ExeDir() (string, error) { // GetFirstLineFromFile retrieves the first line of the specified file. func GetFirstLineFromFile(netFile string) (string, error) { - addrStr, err := ioutil.ReadFile(netFile) + addrStr, err := os.ReadFile(netFile) if err != nil { return "", err } @@ -130,7 +129,7 @@ func copyFolder(source string, dest string, info os.FileInfo, includeFilter Incl return fmt.Errorf("error creating destination folder: %v", err) } - contents, err := ioutil.ReadDir(source) + contents, err := os.ReadDir(source) if err != nil { return err } diff --git a/util/metrics/metrics_test.go b/util/metrics/metrics_test.go index fddb9eda60..2e2828b1fb 100644 --- a/util/metrics/metrics_test.go +++ b/util/metrics/metrics_test.go @@ -18,7 +18,7 @@ package metrics import ( "fmt" - "io/ioutil" + "io" "net" "net/http" "strings" @@ -65,7 +65,7 @@ func (p *MetricTest) createListener(endpoint string) int { func (p *MetricTest) testMetricsHandler(w http.ResponseWriter, r *http.Request) { // read the entire request: - body, err := ioutil.ReadAll(r.Body) + body, err := io.ReadAll(r.Body) if err != nil { return } diff --git a/util/tokens/tokens.go b/util/tokens/tokens.go index 7b6d33d472..930f030bbe 100644 --- a/util/tokens/tokens.go +++ b/util/tokens/tokens.go @@ -19,7 +19,7 @@ package tokens import ( "crypto/rand" "fmt" - "io/ioutil" + "os" "path/filepath" "github.com/algorand/go-algorand/util" @@ -59,7 +59,7 @@ func GetAndValidateAPIToken(dataDir, tokenFilename string) (string, error) { // writeAPITokenToDisk persists the APIToken to the datadir func writeAPITokenToDisk(dataDir, tokenFilename, apiToken string) error { filepath := tokenFilepath(dataDir, tokenFilename) - return ioutil.WriteFile(filepath, []byte(apiToken), 0644) + return os.WriteFile(filepath, []byte(apiToken), 0644) } // GenerateAPIToken writes a cryptographically secure APIToken to disk