mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #106020 from ahrtr/replace_ioutil_with_io_os_hack
Replace ioutil with io and os for hack
This commit is contained in:
commit
8facd72986
@ -23,7 +23,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
@ -46,7 +45,7 @@ func checkAllProviders(e2eFile string) error {
|
|||||||
regEndConformance := regexp.MustCompile(patternEndConformance)
|
regEndConformance := regexp.MustCompile(patternEndConformance)
|
||||||
regSkip := regexp.MustCompile(patternSkip)
|
regSkip := regexp.MustCompile(patternSkip)
|
||||||
|
|
||||||
fileInput, err := ioutil.ReadFile(e2eFile)
|
fileInput, err := os.ReadFile(e2eFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to read file %s: %w", e2eFile, err)
|
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 {
|
func processFile(e2ePath string) error {
|
||||||
regGoFile := regexp.MustCompile(`.*\.go`)
|
regGoFile := regexp.MustCompile(`.*\.go`)
|
||||||
|
|
||||||
files, err := ioutil.ReadDir(e2ePath)
|
files, err := os.ReadDir(e2ePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err)
|
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
|
// Search sub directories if exist
|
||||||
files, err := ioutil.ReadDir(e2ePath)
|
files, err := os.ReadDir(e2ePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err)
|
return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user