Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package lua

import (
"bytes"
"io/ioutil"
"io"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions io.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package lua
import (
"fmt"
"io"
"io/ioutil"
"os"
)

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions os.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package lua

import (
"io/ioutil"
"os"
"os/exec"
"syscall"
Expand Down Expand Up @@ -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")
}
Expand Down