Skip to content

Commit 1ee051b

Browse files
dmitshurgopherbot
authored andcommittedSep 8, 2023
all: clean up obsolete +build lines and io/ioutil uses [generated]
The module go directive is at 1.20, so modernize it a bit by applying changes generated by the script below with go1.21.1. [git-generate] go fix ./... gofmt -r 'ioutil.Discard -> io.Discard' -w . gofmt -r 'ioutil.NopCloser -> io.NopCloser' -w . gofmt -r 'ioutil.ReadAll -> io.ReadAll' -w . gofmt -r '"ioutil.ReadAll: %v" -> "io.ReadAll: %v"' -w . gofmt -r 'ioutil.ReadDir -> os.ReadDir' -w . gofmt -r 'ioutil.ReadFile -> os.ReadFile' -w . gofmt -r 'ioutil.TempDir -> os.MkdirTemp' -w . gofmt -r 'ioutil.TempFile -> os.CreateTemp' -w . gofmt -r 'ioutil.WriteFile -> os.WriteFile' -w . goimports -w . Change-Id: I145b27756e7c6101e992747ee822e7237df4cb91 Reviewed-on: https://go-review.googlesource.com/c/build/+/527016 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
1 parent 3a081fc commit 1ee051b

File tree

125 files changed

+146
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+146
-268
lines changed
 

‎autocertcache/autocertcache.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package autocertcache
88

99
import (
1010
"context"
11-
"io/ioutil"
11+
"io"
1212

1313
"cloud.google.com/go/storage"
1414
"golang.org/x/crypto/acme/autocert"
@@ -40,7 +40,7 @@ func (c *gcsAutocertCache) Get(ctx context.Context, key string) ([]byte, error)
4040
return nil, err
4141
}
4242
defer rd.Close()
43-
return ioutil.ReadAll(rd)
43+
return io.ReadAll(rd)
4444
}
4545

4646
func (c *gcsAutocertCache) Put(ctx context.Context, key string, data []byte) error {

‎buildlet/buildlet.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"context"
99
"crypto/tls"
1010
"fmt"
11-
"io/ioutil"
11+
"io"
1212
"log"
1313
"net/http"
1414
"time"
@@ -139,7 +139,7 @@ func probeBuildlet(ctx context.Context, buildletURL string, opts *VMOpts) error
139139
if err != nil {
140140
return fmt.Errorf("error probe buildlet %s: %w", buildletURL, err)
141141
}
142-
ioutil.ReadAll(res.Body)
142+
io.ReadAll(res.Body)
143143
res.Body.Close()
144144
if res.StatusCode != http.StatusOK {
145145
return fmt.Errorf("buildlet returned HTTP status code %d for %s", res.StatusCode, buildletURL)

0 commit comments

Comments
 (0)
Please sign in to comment.