diff --git a/main.go b/main.go index 3ab2225..274a6e4 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "io/ioutil" "os" flag "github.com/spf13/pflag" @@ -39,7 +38,7 @@ func main() { if len(os.Args) == 1 { repl.Start(os.Stdin, os.Stdout) } else { - file, err := ioutil.ReadFile(os.Args[1]) + file, err := os.ReadFile(os.Args[1]) if err == nil { runProgram(string(file)) } diff --git a/object/file.go b/object/file.go index f9588dc..5c7bda7 100644 --- a/object/file.go +++ b/object/file.go @@ -2,8 +2,8 @@ package object import ( "fmt" + "io" "io/fs" - "io/ioutil" "os" "strconv" "strings" @@ -231,7 +231,7 @@ func readFile(o Object, _ []Object, _ Environment) Object { return NewError(err) } - file, err := ioutil.ReadAll(f.Handle) + file, err := io.ReadAll(f.Handle) if err != nil { return NewError(err) } diff --git a/object/http_test.go b/object/http_test.go index 1a4eb12..d8b5706 100644 --- a/object/http_test.go +++ b/object/http_test.go @@ -1,7 +1,7 @@ package object_test import ( - "io/ioutil" + "io" "log" "net/http" "strings" @@ -72,7 +72,7 @@ func TestHTTPServerMethods(t *testing.T) { log.Fatal(err) } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { log.Fatal(err) }