Skip to content

Commit

Permalink
Merge pull request #6174 from filecoin-project/chore/remove-ioutil
Browse files Browse the repository at this point in the history
chore: remove ioutil
  • Loading branch information
simlecode authored Sep 26, 2023
2 parents 2b0b647 + 64cd4b7 commit 6365715
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions venus-devtool/inline-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
Expand All @@ -21,7 +20,7 @@ const (
var data = map[string]interface{}{}

func main() {
db, err := ioutil.ReadFile(os.Args[2])
db, err := os.ReadFile(os.Args[2])
if err != nil {
log.Fatalf("Error reading file: %v", err)
}
Expand All @@ -46,7 +45,7 @@ func processFile(path string, info os.FileInfo, err error) error {
return nil
}

fileBytes, err := ioutil.ReadFile(path)
fileBytes, err := os.ReadFile(path)
if err != nil {
return err
}
Expand Down Expand Up @@ -85,7 +84,7 @@ func processFile(path string, info os.FileInfo, err error) error {
}

if len(outLines) != len(lines) {
err = ioutil.WriteFile(path, []byte(strings.Join(outLines, "\n")), 0)
err = os.WriteFile(path, []byte(strings.Join(outLines, "\n")), 0)
if err != nil {
return fmt.Errorf("writing file: %v", err)
}
Expand Down

0 comments on commit 6365715

Please sign in to comment.