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

Commit

Permalink
Remove ioutil and replace with io/os functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Fasching authored and fasmat committed Apr 28, 2022
1 parent 11507d3 commit 4398c16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
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

0 comments on commit 4398c16

Please sign in to comment.