Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 9ec418b

Browse files
authored
Remove deprecated ioutil (#309)
Signed-off-by: Luca Comellini <luca.com@gmail.com>
1 parent a738f4f commit 9ec418b

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

stackdriver_test.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package stackdriver
1616

1717
import (
1818
"context"
19-
"io/ioutil"
19+
"io"
2020
"net/http"
2121
"net/http/httptest"
2222
"os"
@@ -34,11 +34,9 @@ import (
3434
"google.golang.org/grpc/credentials/insecure"
3535
)
3636

37-
var (
38-
dummyAutodetect = func() gcp.Interface {
39-
return nil
40-
}
41-
)
37+
var dummyAutodetect = func() gcp.Interface {
38+
return nil
39+
}
4240

4341
func init() {
4442
// monitoredresource.Autodetect() takes a few seconds to return when
@@ -98,7 +96,7 @@ func TestExport(t *testing.T) {
9896
if err != nil {
9997
t.Fatal(err)
10098
}
101-
body, err := ioutil.ReadAll(resp.Body)
99+
body, err := io.ReadAll(resp.Body)
102100
if err != nil {
103101
t.Fatal(err)
104102
}

util_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
package stackdriver_test
1616

1717
import (
18-
"io/ioutil"
18+
"os"
1919
)
2020

2121
// readFile is a wrapper to read a file. It is meant for internal use for testing.
2222
func readFile(filename string) ([]byte, error) {
23-
return ioutil.ReadFile(filename)
23+
return os.ReadFile(filename)
2424
}

0 commit comments

Comments
 (0)