Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove refs to deprecated io/ioutil #691

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
3 changes: 1 addition & 2 deletions goconvey.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"flag"
"fmt"
"io/fs"
"io/ioutil"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -59,7 +58,7 @@ func main() {

printHeader()

tmpDir, err := ioutil.TempDir("", "*.goconvey")
tmpDir, err := os.MkdirTemp("", "*.goconvey")
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions web/server/executor/tester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package executor
import (
"errors"
"fmt"
"io/ioutil"
"io"
"log"
"testing"
"time"
Expand All @@ -13,7 +13,7 @@ import (
)

func init() {
log.SetOutput(ioutil.Discard)
log.SetOutput(io.Discard)
}

func TestConcurrentTester(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions web/server/watch/imperative_shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package watch

import (
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -75,7 +74,7 @@ func ReadContents(path string) string {
}
defer file.Close()
reader := io.LimitReader(file, 1024*4)
content, _ := ioutil.ReadAll(reader)
content, _ := io.ReadAll(reader)
return string(content)
}

Expand Down
11 changes: 6 additions & 5 deletions web/server/watch/util_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Credits: https://gist.github.com/jaybill/2876519
package watch

import "os"
import "io"
import "io/ioutil"
import "log"
import (
"io"
"log"
"os"
)

// Copies original source to destination destination.
func CopyFile(source string, destination string) (err error) {
Expand Down Expand Up @@ -58,7 +59,7 @@ func CopyDir(source string, destination string) (err error) {
return err
}

entries, err := ioutil.ReadDir(source)
entries, err := os.ReadDir(source)

for _, entry := range entries {

Expand Down