From 0a0db662943fa2c3cc392994d9e80b3c63990ddd Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Wed, 16 Apr 2025 22:25:16 +0530 Subject: [PATCH] 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 --- pkg/library/env/workspaceenv_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/library/env/workspaceenv_test.go b/pkg/library/env/workspaceenv_test.go index 9b5ae16d0..efa13855f 100644 --- a/pkg/library/env/workspaceenv_test.go +++ b/pkg/library/env/workspaceenv_test.go @@ -14,7 +14,7 @@ package env import ( - "io/ioutil" + "os" "path/filepath" "testing" @@ -61,7 +61,7 @@ type TestOutput struct { } func loadTestCaseOrPanic(t *testing.T, testFilepath string) TestCase { - bytes, err := ioutil.ReadFile(testFilepath) + bytes, err := os.ReadFile(testFilepath) if err != nil { t.Fatal(err) } @@ -73,7 +73,7 @@ func loadTestCaseOrPanic(t *testing.T, testFilepath string) TestCase { } func loadAllTestsOrPanic(t *testing.T, fromDir string) []TestCase { - files, err := ioutil.ReadDir(fromDir) + files, err := os.ReadDir(fromDir) if err != nil { t.Fatal(err) }