Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove deprecated io/ioutil methods #1277

Merged
merged 15 commits into from
Nov 8, 2023
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 @@
"fmt"
"go/parser"
"go/token"
"io/ioutil"
"os"
"path/filepath"
"reflect"
Expand Down Expand Up @@ -1095,7 +1094,7 @@

// 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 @@
"go/format"
"go/parser"
"go/token"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -112,7 +111,7 @@
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 @@
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -172,9 +171,9 @@
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
Loading