diff --git a/condor.go b/condor.go index 44e929a..f3b6ae6 100644 --- a/condor.go +++ b/condor.go @@ -17,7 +17,6 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" "os" "os/exec" "path" @@ -116,7 +115,7 @@ func (cl *CondorLauncher) storeConfig(s *model.Job) error { sdir = path.Join(sdir, "logs") } fname := path.Join(sdir, "irods-config") - err = ioutil.WriteFile(fname, fileContent.Bytes(), 0644) + err = os.WriteFile(fname, fileContent.Bytes(), 0644) if err != nil { return errors.Wrapf(err, "failed to write to file %s", fname) } diff --git a/fs.go b/fs.go index f6054c2..a563e93 100644 --- a/fs.go +++ b/fs.go @@ -1,7 +1,6 @@ package main import ( - "io/ioutil" "os" ) @@ -19,5 +18,5 @@ func (o *osys) MkdirAll(path string, mode os.FileMode) error { } func (o *osys) WriteFile(path string, contents []byte, mode os.FileMode) error { - return ioutil.WriteFile(path, contents, mode) + return os.WriteFile(path, contents, mode) } diff --git a/test/utils.go b/test/utils.go index 34fcc25..9ff5f0d 100644 --- a/test/utils.go +++ b/test/utils.go @@ -2,7 +2,7 @@ package test import ( "fmt" - "io/ioutil" + "io" "os" "path" "runtime" @@ -76,7 +76,12 @@ func InitTestsFromFile(t *testing.T, cfg *viper.Viper, filename string) *model.J // Load the job submission information from the file. path := getTestFilePath(t, filename) - data, err := ioutil.ReadFile(path) + f, err := os.Open(path) + if err != nil { + t.Error(err) + } + defer f.Close() + data, err := io.ReadAll(f) if err != nil { t.Error(err) }