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
7 changes: 4 additions & 3 deletions console.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"time"
Expand Down Expand Up @@ -57,7 +56,9 @@ type ConsoleOpts struct {
// ExpectObserver provides an interface for a function callback that will
// be called after each Expect operation.
// matchers will be the list of active matchers when an error occurred,
// or a list of matchers that matched `buf` when err is nil.
//
// or a list of matchers that matched `buf` when err is nil.
//
// buf is the captured output that was matched against.
// err is error that might have occurred. May be nil.
type ExpectObserver func(matchers []Matcher, buf string, err error)
Expand Down Expand Up @@ -136,7 +137,7 @@ func WithDefaultTimeout(timeout time.Duration) ConsoleOpt {
// NewConsole returns a new Console with the given options.
func NewConsole(opts ...ConsoleOpt) (*Console, error) {
options := ConsoleOpts{
Logger: log.New(ioutil.Discard, "", 0),
Logger: log.New(io.Discard, "", 0),
}

for _, opt := range opts {
Expand Down
5 changes: 2 additions & 3 deletions expect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -336,7 +335,7 @@ func TestEditor(t *testing.T) {
}
defer testCloser(t, c)

file, err := ioutil.TempFile("", "")
file, err := os.CreateTemp("", "")
if err != nil {
t.Errorf("Expected no error but got '%s'", err)
}
Expand All @@ -363,7 +362,7 @@ func TestEditor(t *testing.T) {
testCloser(t, c.Tty())
wg.Wait()

data, err := ioutil.ReadFile(file.Name())
data, err := os.ReadFile(file.Name())
if err != nil {
t.Errorf("Expected no error but got '%s'", err)
}
Expand Down