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 @@ 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)
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)
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)
}

var pkgName gnolang.Name
Expand Down