deps: Update ioutil deprecated library references to os and io respectively in the client package (#16318)

* Update ioutil deprecated library references to os and io respectively

* Deal with the errors produced.

Add error handling to filEntry info
Add error handling to info
This commit is contained in:
Lance Haig
2023-03-08 20:25:10 +01:00
committed by GitHub
parent 3160c76209
commit 48e7d70fcd
34 changed files with 112 additions and 127 deletions

View File

@@ -1,7 +1,6 @@
package allocdir
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
@@ -55,11 +54,11 @@ func TestTaskDir_EmbedDirs(t *testing.T) {
file := "foo"
subFile := "bar"
if err := ioutil.WriteFile(filepath.Join(host, file), []byte{'a'}, 0777); err != nil {
if err := os.WriteFile(filepath.Join(host, file), []byte{'a'}, 0777); err != nil {
t.Fatalf("Couldn't create file in host dir %v: %v", host, err)
}
if err := ioutil.WriteFile(filepath.Join(subDir, subFile), []byte{'a'}, 0777); err != nil {
if err := os.WriteFile(filepath.Join(subDir, subFile), []byte{'a'}, 0777); err != nil {
t.Fatalf("Couldn't create file in host subdir %v: %v", subDir, err)
}