From 6e3cf5eca27c781d54ef59e9027d83dcbf910fe1 Mon Sep 17 00:00:00 2001 From: ahrtr Date: Sat, 30 Oct 2021 14:44:41 +0800 Subject: [PATCH] replace ioutil with io and os for hack --- hack/conformance/check_conformance_test_requirements.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hack/conformance/check_conformance_test_requirements.go b/hack/conformance/check_conformance_test_requirements.go index 3798b0a7d03..d233a21e578 100644 --- a/hack/conformance/check_conformance_test_requirements.go +++ b/hack/conformance/check_conformance_test_requirements.go @@ -23,7 +23,6 @@ import ( "bytes" "errors" "fmt" - "io/ioutil" "os" "regexp" @@ -46,7 +45,7 @@ func checkAllProviders(e2eFile string) error { regEndConformance := regexp.MustCompile(patternEndConformance) regSkip := regexp.MustCompile(patternSkip) - fileInput, err := ioutil.ReadFile(e2eFile) + fileInput, err := os.ReadFile(e2eFile) if err != nil { return fmt.Errorf("Failed to read file %s: %w", e2eFile, err) } @@ -84,7 +83,7 @@ func checkAllProviders(e2eFile string) error { func processFile(e2ePath string) error { regGoFile := regexp.MustCompile(`.*\.go`) - files, err := ioutil.ReadDir(e2ePath) + files, err := os.ReadDir(e2ePath) if err != nil { return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err) } @@ -111,7 +110,7 @@ func processDir(e2ePath string) error { } // Search sub directories if exist - files, err := ioutil.ReadDir(e2ePath) + files, err := os.ReadDir(e2ePath) if err != nil { return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err) }