diff --git a/hack/conformance/check_conformance_test_requirements.go b/hack/conformance/check_conformance_test_requirements.go index 29eeb5c66ad..3798b0a7d03 100644 --- a/hack/conformance/check_conformance_test_requirements.go +++ b/hack/conformance/check_conformance_test_requirements.go @@ -21,12 +21,12 @@ package main import ( "bufio" "bytes" + "errors" "fmt" "io/ioutil" "os" "regexp" - "github.com/pkg/errors" "github.com/spf13/cobra" ) @@ -48,7 +48,7 @@ func checkAllProviders(e2eFile string) error { fileInput, err := ioutil.ReadFile(e2eFile) if err != nil { - return errors.Wrapf(err, "Failed to read file %s", e2eFile) + return fmt.Errorf("Failed to read file %s: %w", e2eFile, err) } scanner := bufio.NewScanner(bytes.NewReader(fileInput)) scanner.Split(bufio.ScanLines) @@ -57,7 +57,7 @@ func checkAllProviders(e2eFile string) error { line := scanner.Text() if regStartConformance.MatchString(line) { if inConformanceCode { - return errors.Errorf("Missed the end of previous conformance test. There might be a bug in this script.") + return errors.New("Missed the end of previous conformance test. There might be a bug in this script.") } inConformanceCode = true } @@ -73,10 +73,10 @@ func checkAllProviders(e2eFile string) error { } } if inConformanceCode { - return errors.Errorf("Missed the end of previous conformance test. There might be a bug in this script.") + return errors.New("Missed the end of previous conformance test. There might be a bug in this script.") } if checkFailed { - return errors.Errorf("We need to fix the above errors.") + return errors.New("We need to fix the above errors.") } return nil } @@ -86,7 +86,7 @@ func processFile(e2ePath string) error { files, err := ioutil.ReadDir(e2ePath) if err != nil { - return errors.Wrapf(err, "Failed to read dir %s", e2ePath) + return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err) } for _, file := range files { if file.IsDir() { @@ -113,7 +113,7 @@ func processDir(e2ePath string) error { // Search sub directories if exist files, err := ioutil.ReadDir(e2ePath) if err != nil { - return errors.Wrapf(err, "Failed to read dir %s", e2ePath) + return fmt.Errorf("Failed to read dir %s: %w", e2ePath, err) } for _, file := range files { if !file.IsDir() {