Skip to content

Commit 8f59180

Browse files
fix(storage): update practices from deprecated ioutil to io (#4652)
1 parent eab1b4a commit 8f59180

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

storage/objects/download_public_file.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"context"
2020
"fmt"
2121
"io"
22-
"io/ioutil"
2322
"time"
2423

2524
"cloud.google.com/go/storage"
@@ -47,9 +46,9 @@ func downloadPublicFile(w io.Writer, bucket, object string) ([]byte, error) {
4746
}
4847
defer rc.Close()
4948

50-
data, err := ioutil.ReadAll(rc)
49+
data, err := io.ReadAll(rc)
5150
if err != nil {
52-
return nil, fmt.Errorf("ioutil.ReadAll: %w", err)
51+
return nil, fmt.Errorf("io.ReadAll: %w", err)
5352
}
5453
fmt.Fprintf(w, "Blob %v downloaded.\n", object)
5554
return data, nil

0 commit comments

Comments
 (0)