diff --git a/goconvey.go b/goconvey.go index 22ce6aec..172dd841 100644 --- a/goconvey.go +++ b/goconvey.go @@ -10,7 +10,6 @@ import ( "flag" "fmt" "io/fs" - "io/ioutil" "log" "net" "net/http" @@ -59,7 +58,7 @@ func main() { printHeader() - tmpDir, err := ioutil.TempDir("", "*.goconvey") + tmpDir, err := os.MkdirTemp("", "*.goconvey") if err != nil { log.Fatal(err) } diff --git a/web/server/executor/tester_test.go b/web/server/executor/tester_test.go index d540c546..f9e8a9d9 100644 --- a/web/server/executor/tester_test.go +++ b/web/server/executor/tester_test.go @@ -3,7 +3,7 @@ package executor import ( "errors" "fmt" - "io/ioutil" + "io" "log" "testing" "time" @@ -13,7 +13,7 @@ import ( ) func init() { - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) } func TestConcurrentTester(t *testing.T) { diff --git a/web/server/watch/imperative_shell.go b/web/server/watch/imperative_shell.go index 9d9890d2..0cf9a276 100644 --- a/web/server/watch/imperative_shell.go +++ b/web/server/watch/imperative_shell.go @@ -2,7 +2,6 @@ package watch import ( "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -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) } diff --git a/web/server/watch/util_test.go b/web/server/watch/util_test.go index b5ac11fa..d3ea9b30 100644 --- a/web/server/watch/util_test.go +++ b/web/server/watch/util_test.go @@ -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) { @@ -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 {