Refactor: move from io/ioutil to io and os package (#2234)

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <zerjun@beatchain.co>
This commit is contained in:
Eng Zer Jun
2021-09-06 18:33:42 +08:00
committed by GitHub
parent f8ac24db27
commit 426aa7af34
49 changed files with 143 additions and 171 deletions
+1 -2
View File
@@ -21,7 +21,6 @@ import (
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"os"
"strings"
@@ -63,7 +62,7 @@ func GetChartSource(path string) (string, error) {
return "", err
}
defer os.Remove(packagedPath)
packaged, err := ioutil.ReadFile(packagedPath)
packaged, err := os.ReadFile(packagedPath)
if err != nil {
return "", err
}