diff --git a/mob.go b/mob.go index 91513d40..9b71cede 100644 --- a/mob.go +++ b/mob.go @@ -12,7 +12,7 @@ import ( "github.com/remotemobprogramming/mob/v4/help" "github.com/remotemobprogramming/mob/v4/open" "github.com/remotemobprogramming/mob/v4/say" - "io/ioutil" + "io" "net/http" "net/url" "os" @@ -764,7 +764,7 @@ func sendRequest(requestBody []byte, requestMethod string, requestUrl string, di return fmt.Errorf("failed to make the http request: %w", responseErr) } defer response.Body.Close() - body, responseReadingErr := ioutil.ReadAll(response.Body) + body, responseReadingErr := io.ReadAll(response.Body) if responseReadingErr != nil { return fmt.Errorf("failed to read the http response: %w", responseReadingErr) } diff --git a/mob_test.go b/mob_test.go index 4cc7dd78..259a285a 100644 --- a/mob_test.go +++ b/mob_test.go @@ -6,7 +6,6 @@ import ( "github.com/remotemobprogramming/mob/v4/open" "github.com/remotemobprogramming/mob/v4/say" "github.com/remotemobprogramming/mob/v4/test" - "io/ioutil" "os" "path/filepath" "reflect" @@ -2044,7 +2043,7 @@ func createFile(t *testing.T, filename string, content string) (pathToFile strin func createFileInPath(t *testing.T, path, filename, content string) (pathToFile string) { contentAsBytes := []byte(content) pathToFile = path + "/" + filename - err := ioutil.WriteFile(pathToFile, contentAsBytes, 0644) + err := os.WriteFile(pathToFile, contentAsBytes, 0644) if err != nil { failWithFailure(t, "creating file "+filename+" with content "+content, "error") } diff --git a/squash_wip.go b/squash_wip.go index c438f0d7..cfcb6645 100644 --- a/squash_wip.go +++ b/squash_wip.go @@ -4,7 +4,6 @@ import ( config "github.com/remotemobprogramming/mob/v4/configuration" "github.com/remotemobprogramming/mob/v4/say" "io" - "io/ioutil" "os" "path/filepath" "strconv" @@ -104,7 +103,7 @@ func squashWipGitSequenceEditor(fileName string, configuration config.Configurat func replaceFileContents(fileName string, replacer Replacer) { file, _ := os.OpenFile(fileName, os.O_RDWR, 0666) - input, err := ioutil.ReadAll(file) + input, err := io.ReadAll(file) if err != nil { panic(err) } diff --git a/squash_wip_test.go b/squash_wip_test.go index 3066e0cd..9823fb2f 100644 --- a/squash_wip_test.go +++ b/squash_wip_test.go @@ -3,7 +3,6 @@ package main import ( "fmt" config "github.com/remotemobprogramming/mob/v4/configuration" - "io/ioutil" "os" "strings" "testing" @@ -405,7 +404,7 @@ new file squashWipGitEditor(input, config.GetDefaultConfiguration()) - result, _ := ioutil.ReadFile(input) + result, _ := os.ReadFile(input) equals(t, expected, string(result)) } @@ -431,7 +430,7 @@ squash c51a56d manual commit squashWipGitSequenceEditor(input, config.GetDefaultConfiguration()) - result, _ := ioutil.ReadFile(input) + result, _ := os.ReadFile(input) equals(t, expected, string(result)) } diff --git a/test/test.go b/test/test.go index b352c779..7fd681d4 100644 --- a/test/test.go +++ b/test/test.go @@ -3,7 +3,7 @@ package test import ( "fmt" "github.com/remotemobprogramming/mob/v4/say" - "io/ioutil" + "os" "path/filepath" "reflect" "runtime" @@ -44,7 +44,7 @@ func failWithFailureMessage(t *testing.T, message string) { func CreateFile(t *testing.T, filename string, content string) (pathToFile string) { contentAsBytes := []byte(content) pathToFile = workingDir + "/" + filename - err := ioutil.WriteFile(pathToFile, contentAsBytes, 0644) + err := os.WriteFile(pathToFile, contentAsBytes, 0644) if err != nil { failWithFailure(t, "creating file "+filename+" with content "+content, "error") }