Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Remove ioutil package #2252

Merged
merged 1 commit into from
Apr 28, 2022
Merged
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
4 changes: 2 additions & 2 deletions plugins/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package plugins

import (
"context"
"io/ioutil"
"os"
"strings"
"testing"
"time"
Expand All @@ -20,7 +20,7 @@ func TestAskBin_respectsTimeout(t *testing.T) {
return
}

if fileEntries, err := ioutil.ReadDir(from); err == nil {
if fileEntries, err := os.ReadDir(from); err == nil {
found := false
for _, e := range fileEntries {
if strings.HasPrefix(e.Name(), "buffalo-") {
Expand Down
18 changes: 9 additions & 9 deletions router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package buffalo

import (
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"path"
Expand Down Expand Up @@ -98,7 +98,7 @@ func Test_Mount_Buffalo(t *testing.T) {
r.NoError(err)
res, err := http.DefaultClient.Do(req)
r.NoError(err)
b, _ := ioutil.ReadAll(res.Body)
b, _ := io.ReadAll(res.Body)
r.Equal(fmt.Sprintf("%s - %s/", m, u), string(b))
}
}
Expand All @@ -123,7 +123,7 @@ func Test_Mount_Buffalo_on_Group(t *testing.T) {
r.NoError(err)
res, err := http.DefaultClient.Do(req)
r.NoError(err)
b, _ := ioutil.ReadAll(res.Body)
b, _ := io.ReadAll(res.Body)
r.Equal(fmt.Sprintf("%s - %s/", m, u), string(b))
}
}
Expand Down Expand Up @@ -158,7 +158,7 @@ func Test_Mount_Handler(t *testing.T) {
r.NoError(err)
res, err := http.DefaultClient.Do(req)
r.NoError(err)
b, _ := ioutil.ReadAll(res.Body)
b, _ := io.ReadAll(res.Body)
r.Equal(fmt.Sprintf("%s - %s/", m, u), string(b))
}
}
Expand Down Expand Up @@ -197,7 +197,7 @@ func Test_PreHandlers(t *testing.T) {
r.NoError(err)
res, err := http.DefaultClient.Do(req)
r.NoError(err)
b, err := ioutil.ReadAll(res.Body)
b, err := io.ReadAll(res.Body)
r.NoError(err)
r.Equal(v.Code, res.StatusCode)
r.Equal(v.Result, string(b))
Expand Down Expand Up @@ -242,7 +242,7 @@ func Test_PreWares(t *testing.T) {
r.NoError(err)
res, err := http.DefaultClient.Do(req)
r.NoError(err)
b, err := ioutil.ReadAll(res.Body)
b, err := io.ReadAll(res.Body)
r.NoError(err)
r.Equal(v.Code, res.StatusCode)
r.Equal(v.Result, string(b))
Expand All @@ -269,7 +269,7 @@ func Test_Router(t *testing.T) {
r.NoError(err)
res, err := http.DefaultClient.Do(req)
r.NoError(err)
b, _ := ioutil.ReadAll(res.Body)
b, _ := io.ReadAll(res.Body)
r.Equal(fmt.Sprintf("%s|/router/tests", v), string(b))
}
}
Expand Down Expand Up @@ -552,7 +552,7 @@ func Test_Resource(t *testing.T) {
r.NoError(err)
res, err := c.Do(req)
r.NoError(err)
b, err := ioutil.ReadAll(res.Body)
b, err := io.ReadAll(res.Body)
r.NoError(err)
r.Equal(test.Result, string(b))
}
Expand Down Expand Up @@ -710,7 +710,7 @@ func Test_ResourceOnResource(t *testing.T) {
r.NoError(err)
res, err := c.Do(req)
r.NoError(err)
b, err := ioutil.ReadAll(res.Body)
b, err := io.ReadAll(res.Body)
r.NoError(err)
r.Equal(test.Result, string(b))
}
Expand Down