@@ -26,7 +26,7 @@ import (
26
26
"context"
27
27
"crypto/md5"
28
28
"fmt"
29
- "io/ioutil "
29
+ "io"
30
30
"net/url"
31
31
"os"
32
32
"path"
@@ -67,7 +67,7 @@ var specialNames = []string{
67
67
// note: this is to emulate the list-of-files flag
68
68
// nolint
69
69
func (scenarioHelper ) generateListOfFiles (c asserter , fileList []string ) (path string ) {
70
- parentDirName , err := ioutil . TempDir ("" , "AzCopyLocalTest" )
70
+ parentDirName , err := os . MkdirTemp ("" , "AzCopyLocalTest" )
71
71
c .AssertNoErr (err )
72
72
73
73
// create the file
@@ -77,14 +77,14 @@ func (scenarioHelper) generateListOfFiles(c asserter, fileList []string) (path s
77
77
78
78
// pipe content into it
79
79
content := strings .Join (fileList , "\n " )
80
- err = ioutil .WriteFile (path , []byte (content ), common .DEFAULT_FILE_PERM )
80
+ err = os .WriteFile (path , []byte (content ), common .DEFAULT_FILE_PERM )
81
81
c .AssertNoErr (err )
82
82
return
83
83
}
84
84
85
85
// nolint
86
86
func (scenarioHelper ) generateLocalDirectory (c asserter ) (dstDirName string ) {
87
- dstDirName , err := ioutil . TempDir ("" , "AzCopyLocalTest" )
87
+ dstDirName , err := os . MkdirTemp ("" , "AzCopyLocalTest" )
88
88
c .AssertNoErr (err )
89
89
return
90
90
}
@@ -101,7 +101,7 @@ func (scenarioHelper) generateLocalFile(filePath string, fileSize int) ([]byte,
101
101
}
102
102
103
103
// write to file and return the data
104
- err = ioutil .WriteFile (filePath , bigBuff , common .DEFAULT_FILE_PERM )
104
+ err = os .WriteFile (filePath , bigBuff , common .DEFAULT_FILE_PERM )
105
105
return bigBuff , err
106
106
}
107
107
@@ -529,7 +529,7 @@ func (s scenarioHelper) downloadBlobContent(a asserter, options downloadContentO
529
529
retryReader := downloadResp .Body (azblob.RetryReaderOptions {})
530
530
defer retryReader .Close ()
531
531
532
- destData , err := ioutil .ReadAll (retryReader )
532
+ destData , err := io .ReadAll (retryReader )
533
533
a .AssertNoErr (err )
534
534
return destData [:]
535
535
}
@@ -910,7 +910,7 @@ func (s scenarioHelper) downloadFileContent(a asserter, options downloadContentO
910
910
retryReader := downloadResp .Body (azfile.RetryReaderOptions {})
911
911
defer retryReader .Close () // The client must close the response body when finished with it
912
912
913
- destData , err := ioutil .ReadAll (retryReader )
913
+ destData , err := io .ReadAll (retryReader )
914
914
a .AssertNoErr (err )
915
915
downloadResp .Body (azfile.RetryReaderOptions {})
916
916
return destData
0 commit comments