replace deprecated io/ioutil with os and io for cmd

This commit is contained in:
ahrtr
2021-11-02 08:54:28 +08:00
parent 6dd234d85c
commit 972dc46a1f
73 changed files with 187 additions and 239 deletions

View File

@@ -19,7 +19,6 @@ package app
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
@@ -406,7 +405,7 @@ func TestProcessHostnameOverrideFlag(t *testing.T) {
func TestConfigChange(t *testing.T) {
setUp := func() (*os.File, string, error) {
tempDir, err := ioutil.TempDir("", "kubeproxy-config-change")
tempDir, err := os.MkdirTemp("", "kubeproxy-config-change")
if err != nil {
return nil, "", fmt.Errorf("unable to create temporary directory: %v", err)
}