diff --git a/dump_test.go b/dump_test.go index 5a65a2a..a1e9dd8 100644 --- a/dump_test.go +++ b/dump_test.go @@ -2,7 +2,7 @@ package lua import ( "bytes" - "io/ioutil" + "io" "os" "os/exec" "path/filepath" @@ -45,11 +45,11 @@ func TestUndumpThenDumpReturnsTheSameFunction(t *testing.T) { t.Error("unexpected error", err, "with testing dump") } - expectedBinary, err := ioutil.ReadFile(binary) + expectedBinary, err := os.ReadFile(binary) if err != nil { t.Error("error reading file", err) } - actualBinary, err := ioutil.ReadAll(&out) + actualBinary, err := io.ReadAll(&out) if err != nil { t.Error("error reading out bugger", err) } diff --git a/io.go b/io.go index 2bacd86..5933694 100644 --- a/io.go +++ b/io.go @@ -3,7 +3,6 @@ package lua import ( "fmt" "io" - "io/ioutil" "os" ) @@ -231,7 +230,7 @@ var ioLibrary = []RegistryFunction{ {"read", func(l *State) int { return read(l, ioFile(l, input), 1) }}, {"tmpfile", func(l *State) int { s := newFile(l) - f, err := ioutil.TempFile("", "") + f, err := os.CreateTemp("", "") if err == nil { s.f = f return 1 diff --git a/os.go b/os.go index ae9210e..5365212 100644 --- a/os.go +++ b/os.go @@ -1,7 +1,6 @@ package lua import ( - "io/ioutil" "os" "os/exec" "syscall" @@ -130,7 +129,7 @@ var osLibrary = []RegistryFunction{ return 1 }}, {"tmpname", func(l *State) int { - f, err := ioutil.TempFile("", "lua_") + f, err := os.CreateTemp("", "lua_") if err != nil { Errorf(l, "unable to generate a unique filename") }