Skip to content

Commit 72e437f

Browse files
chore: replace usages of ioutil (#1792)
1 parent 8aa41b8 commit 72e437f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pkg/api/metrics/metrics_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ package metrics_test
22

33
import (
44
"fmt"
5-
"io/ioutil"
5+
"io"
66
"net/http"
77
"net/http/httptest"
88
"strings"
99
"testing"
1010

11+
. "github.com/onsi/ginkgo"
12+
. "github.com/onsi/gomega"
13+
1114
"github.com/containrrr/watchtower/pkg/api"
1215
metricsAPI "github.com/containrrr/watchtower/pkg/api/metrics"
1316
"github.com/containrrr/watchtower/pkg/metrics"
14-
15-
. "github.com/onsi/ginkgo"
16-
. "github.com/onsi/gomega"
1717
)
1818

1919
const (
@@ -36,7 +36,7 @@ func getWithToken(handler http.Handler) map[string]string {
3636
handler.ServeHTTP(respWriter, req)
3737

3838
res := respWriter.Result()
39-
body, _ := ioutil.ReadAll(res.Body)
39+
body, _ := io.ReadAll(res.Body)
4040

4141
for _, line := range strings.Split(string(body), "\n") {
4242
if len(line) < 1 || line[0] == '#' {

pkg/container/client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ package container
33
import (
44
"bytes"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"strings"
88
"time"
99

10-
"github.com/containrrr/watchtower/pkg/registry"
11-
"github.com/containrrr/watchtower/pkg/registry/digest"
12-
13-
t "github.com/containrrr/watchtower/pkg/types"
1410
"github.com/docker/docker/api/types"
1511
"github.com/docker/docker/api/types/container"
1612
"github.com/docker/docker/api/types/filters"
1713
"github.com/docker/docker/api/types/network"
1814
sdkClient "github.com/docker/docker/client"
1915
log "github.com/sirupsen/logrus"
2016
"golang.org/x/net/context"
17+
18+
"github.com/containrrr/watchtower/pkg/registry"
19+
"github.com/containrrr/watchtower/pkg/registry/digest"
20+
t "github.com/containrrr/watchtower/pkg/types"
2121
)
2222

2323
const defaultStopSignal = "SIGTERM"
@@ -399,7 +399,7 @@ func (client dockerClient) PullImage(ctx context.Context, container t.Container)
399399

400400
defer response.Close()
401401
// the pull request will be aborted prematurely unless the response is read
402-
if _, err = ioutil.ReadAll(response); err != nil {
402+
if _, err = io.ReadAll(response); err != nil {
403403
log.Error(err)
404404
return err
405405
}

0 commit comments

Comments
 (0)