Skip to content

Commit fe24d19

Browse files
committed
refactor: Replace deprecated ioutil.ReadFile and ioutil.ReadDir in workspaceenv_test
Updated code to use `os.ReadFile` and `os.ReadDir`, as `ioutil` package was deprecated in Go 1.16. Signed-off-by: Rohan Kumar <[email protected]>
1 parent 2275311 commit fe24d19

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/library/env/workspaceenv_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
package env
1515

1616
import (
17-
"io/ioutil"
17+
"os"
1818
"path/filepath"
1919
"testing"
2020

@@ -61,7 +61,7 @@ type TestOutput struct {
6161
}
6262

6363
func loadTestCaseOrPanic(t *testing.T, testFilepath string) TestCase {
64-
bytes, err := ioutil.ReadFile(testFilepath)
64+
bytes, err := os.ReadFile(testFilepath)
6565
if err != nil {
6666
t.Fatal(err)
6767
}
@@ -73,7 +73,7 @@ func loadTestCaseOrPanic(t *testing.T, testFilepath string) TestCase {
7373
}
7474

7575
func loadAllTestsOrPanic(t *testing.T, fromDir string) []TestCase {
76-
files, err := ioutil.ReadDir(fromDir)
76+
files, err := os.ReadDir(fromDir)
7777
if err != nil {
7878
t.Fatal(err)
7979
}

0 commit comments

Comments
 (0)