refactor: move from io/ioutil to io and os packages (#1417)

The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil
Signed-off-by: Eng Zer Jun <[email protected]>

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Eng Zer Junandmergify[bot] authored and GitHub committed 2022-10-29 17:15:38 +00:00
1 parent a73d5063d8
commit 2f1c5a19f1
7 files changed
+25 -30

No files matched your search

+1 -3
View File
@@ -48,9 +48,7 @@ func CopyDir(source string, dest string) (err error) {
return err
}
directory, _ := os.Open(source)
objects, err := directory.Readdir(-1)
objects, err := os.ReadDir(source)
for _, obj := range objects {
sourcefilepointer := source + "/" + obj.Name()