diff options
author | Damian Gryski <[email protected]> | 2022-08-05 12:26:15 -0700 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-08-07 10:32:23 +0200 |
commit | edbbca5614fc5694d0c631cbcea73c7e2e90b336 (patch) | |
tree | cf46bf79f6a7edbb3d4966d8a93d50950d1347ca /loader | |
parent | 13f21477b118e3f410a196cafcf2e46823e8ba61 (diff) | |
download | tinygo-edbbca5614fc5694d0c631cbcea73c7e2e90b336.tar.gz tinygo-edbbca5614fc5694d0c631cbcea73c7e2e90b336.zip |
all: remove calls to deprecated ioutil package
Fixes produced via semgrep and https://github.com/dgryski/semgrep-go/blob/master/ioutil.yml
Diffstat (limited to 'loader')
-rw-r--r-- | loader/goroot.go | 2 | ||||
-rw-r--r-- | loader/loader.go | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/loader/goroot.go b/loader/goroot.go index a012fc19f..5039ed295 100644 --- a/loader/goroot.go +++ b/loader/goroot.go @@ -83,7 +83,7 @@ func GetCachedGoroot(config *compileopts.Config) (string, error) { } // Create a temporary directory to construct the goroot within. - tmpgoroot, err := ioutil.TempDir(goenv.Get("GOCACHE"), cachedGorootName+".tmp") + tmpgoroot, err := os.MkdirTemp(goenv.Get("GOCACHE"), cachedGorootName+".tmp") if err != nil { return "", err } diff --git a/loader/loader.go b/loader/loader.go index 730eb7017..6f49982db 100644 --- a/loader/loader.go +++ b/loader/loader.go @@ -13,7 +13,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "os" "os/exec" "path" @@ -335,7 +334,7 @@ func (p *Package) OriginalDir() string { // parseFile is a wrapper around parser.ParseFile. func (p *Package) parseFile(path string, mode parser.Mode) (*ast.File, error) { originalPath := p.program.getOriginalPath(path) - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) if err != nil { return nil, err } |