refactor: move from io/ioutil to io and os packages (#5266)
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 <engzerjun@gmail.com>
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package helmwrapper
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@@ -42,7 +41,7 @@ func TestHelmInstall(t *testing.T) {
|
||||
|
||||
func TempDir(t *testing.T) string {
|
||||
t.Helper()
|
||||
d, err := ioutil.TempDir("", "kubesphere")
|
||||
d, err := os.MkdirTemp("", "kubesphere")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -66,7 +65,7 @@ func GenerateChartData(t *testing.T, name string) string {
|
||||
if err != nil {
|
||||
t.Fatalf("Error creating chart for test: %v", err)
|
||||
}
|
||||
charData, err := ioutil.ReadFile(filename)
|
||||
charData, err := os.ReadFile(filename)
|
||||
if err != nil {
|
||||
t.Fatalf("Error loading chart data %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user