Skip to content

Commit

Permalink
Fix some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
gdubicki committed Apr 20, 2024
1 parent 37a5e3b commit 4ad4088
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main_test

import (
"io/ioutil"
"io"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -41,7 +41,7 @@ func TestMain(m *testing.M) {

defer func() { os.Exit(retcode) }()

tempdir, err = ioutil.TempDir("", "*")
tempdir, err = os.MkdirTemp("", "*")
if err != nil {
log.Fatal(err)
}
Expand All @@ -52,7 +52,7 @@ func TestMain(m *testing.M) {
// Build ets and test fixtures to tempdir.
compile(rootdir, executable)
fixturesdir := path.Join(rootdir, "fixtures")
content, err := ioutil.ReadDir(fixturesdir)
content, err := os.ReadDir(fixturesdir)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -377,7 +377,7 @@ func TestWindowSize(t *testing.T) {
t.Fatalf("failed to start command in pty: %s", err)
}
defer func() { _ = ptmx.Close() }()
output, err := ioutil.ReadAll(ptmx)
output, err := io.ReadAll(ptmx)
// TODO: figure out why we get &os.PathError{Op:"read", Path:"/dev/ptmx", Err:0x5} on Linux.
// https://github.com/creack/pty/issues/100
if len(output) == 0 && err != nil {
Expand Down

0 comments on commit 4ad4088

Please sign in to comment.