aboutsummaryrefslogtreecommitdiffhomepage
path: root/goenv
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2022-08-05 12:26:15 -0700
committerRon Evans <[email protected]>2022-08-07 10:32:23 +0200
commitedbbca5614fc5694d0c631cbcea73c7e2e90b336 (patch)
treecf46bf79f6a7edbb3d4966d8a93d50950d1347ca /goenv
parent13f21477b118e3f410a196cafcf2e46823e8ba61 (diff)
downloadtinygo-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 'goenv')
-rw-r--r--goenv/version.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/goenv/version.go b/goenv/version.go
index c67e56daa..910437e0b 100644
--- a/goenv/version.go
+++ b/goenv/version.go
@@ -4,7 +4,7 @@ import (
"errors"
"fmt"
"io"
- "io/ioutil"
+ "os"
"path/filepath"
"regexp"
"strings"
@@ -54,10 +54,10 @@ func GetGorootVersion(goroot string) (major, minor int, err error) {
// toolchain for the given GOROOT path. It is usually of the form `go1.x.y` but
// can have some variations (for beta releases, for example).
func GorootVersionString(goroot string) (string, error) {
- if data, err := ioutil.ReadFile(filepath.Join(goroot, "VERSION")); err == nil {
+ if data, err := os.ReadFile(filepath.Join(goroot, "VERSION")); err == nil {
return string(data), nil
- } else if data, err := ioutil.ReadFile(filepath.Join(
+ } else if data, err := os.ReadFile(filepath.Join(
goroot, "src", "internal", "buildcfg", "zbootstrap.go")); err == nil {
r := regexp.MustCompile("const version = `(.*)`")