Skip to content

Commit 586dce9

Browse files
testwillAlex TymchukJiriCtvrtka
authored
chore: remove refs to deprecated io/ioutil (#690)
Co-authored-by: Alex Tymchuk <[email protected]> Co-authored-by: Jiří Čtvrtka <[email protected]>
1 parent 5e3bf2a commit 586dce9

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

exporter/v1_compatibility_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package exporter
1818
import (
1919
"context"
2020
"encoding/json"
21-
"io/ioutil"
21+
"os"
2222
"path/filepath"
2323
"sort"
2424
"strings"
@@ -100,7 +100,7 @@ func TestMakeLockMetric(t *testing.T) {
100100
}
101101

102102
func TestAddLocksMetrics(t *testing.T) {
103-
buf, err := ioutil.ReadFile(filepath.Join("testdata/", "locks.json"))
103+
buf, err := os.ReadFile(filepath.Join("testdata/", "locks.json"))
104104
assert.NoError(t, err)
105105

106106
var m bson.M
@@ -163,7 +163,7 @@ func TestSumMetrics(t *testing.T) {
163163
testCase := tt
164164

165165
t.Run(tt.name, func(t *testing.T) {
166-
buf, err := ioutil.ReadFile(filepath.Join("testdata/", "get_diagnostic_data.json"))
166+
buf, err := os.ReadFile(filepath.Join("testdata/", "get_diagnostic_data.json"))
167167
assert.NoError(t, err)
168168

169169
var m bson.M

internal/tu/testutils.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"context"
2121
"encoding/json"
2222
"fmt"
23-
"io/ioutil"
2423
"net"
2524
"os"
2625
"os/exec"
@@ -139,7 +138,7 @@ func TestClient(ctx context.Context, port string, t *testing.T) *mongo.Client {
139138

140139
// LoadJSON loads a file and returns the result of unmarshaling it into a bson.M structure.
141140
func LoadJSON(filename string) (bson.M, error) {
142-
buf, err := ioutil.ReadFile(filepath.Clean(filename))
141+
buf, err := os.ReadFile(filepath.Clean(filename))
143142
if err != nil {
144143
return nil, err
145144
}

0 commit comments

Comments
 (0)