Skip to content

Commit

Permalink
notJoon:remove-deprecated-io/ioutil
Browse files Browse the repository at this point in the history
  • Loading branch information
notJoon committed Oct 21, 2023
1 parent f6d500a commit 17e1598
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions gnovm/pkg/gnolang/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -1095,7 +1094,7 @@ func PackageNameFromFileBody(name, body string) Name {

// NOTE: panics if package name is invalid.
func ReadMemPackage(dir string, pkgPath string) *std.MemPackage {
files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)

Check warning on line 1097 in gnovm/pkg/gnolang/nodes.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/nodes.go#L1097

Added line #L1097 was not covered by tests
if err != nil {
panic(err)
}
Expand Down
3 changes: 1 addition & 2 deletions gnovm/pkg/gnolang/precompile.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"go/format"
"go/parser"
"go/token"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -112,7 +111,7 @@ func GetPrecompileFilenameAndTags(gnoFilePath string) (targetFilename, tags stri
func PrecompileAndCheckMempkg(mempkg *std.MemPackage) error {
gofmt := "gofmt"

tmpDir, err := ioutil.TempDir("", mempkg.Name)
tmpDir, err := os.MkdirTemp("", mempkg.Name)

Check warning on line 114 in gnovm/pkg/gnolang/precompile.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnolang/precompile.go#L114

Added line #L114 was not covered by tests
if err != nil {
return err
}
Expand Down
5 changes: 2 additions & 3 deletions gnovm/pkg/gnomod/gnomod.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package gnomod
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -172,9 +171,9 @@ func CreateGnoModFile(rootDir, modPath string) error {
if modPath == "" {
// Check .gno files for package name
// and use it as modPath
files, err := ioutil.ReadDir(rootDir)
files, err := os.ReadDir(rootDir)
if err != nil {
fmt.Errorf("read dir %q: %w", rootDir, err)
return fmt.Errorf("read dir %q: %w", rootDir, err)

Check warning on line 176 in gnovm/pkg/gnomod/gnomod.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/gnomod/gnomod.go#L176

Added line #L176 was not covered by tests
}

var pkgName gnolang.Name
Expand Down

0 comments on commit 17e1598

Please sign in to comment.