From 357b867046298d6d1619f432283e275045aa322c Mon Sep 17 00:00:00 2001 From: James Sheppard Date: Sun, 7 May 2023 17:01:12 +0000 Subject: [PATCH] use fmt pkg for Errorf calls in chartfile.go Signed-off-by: James Sheppard --- pkg/chartutil/chartfile.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/chartutil/chartfile.go b/pkg/chartutil/chartfile.go index 4f537a6e7..98bfc2348 100644 --- a/pkg/chartutil/chartfile.go +++ b/pkg/chartutil/chartfile.go @@ -17,10 +17,10 @@ limitations under the License. package chartutil import ( + "fmt" "os" "path/filepath" - "github.com/pkg/errors" "sigs.k8s.io/yaml" "helm.sh/helm/v3/pkg/chart" @@ -64,17 +64,17 @@ func IsChartDir(dirName string) (bool, error) { if fi, err := os.Stat(dirName); err != nil { return false, err } else if !fi.IsDir() { - return false, errors.Errorf("%q is not a directory", dirName) + return false, fmt.Errorf("%q is not a directory", dirName) } chartYaml := filepath.Join(dirName, ChartfileName) if _, err := os.Stat(chartYaml); os.IsNotExist(err) { - return false, errors.Errorf("no %s exists in directory %q", ChartfileName, dirName) + return false, fmt.Errorf("no %s exists in directory %q", ChartfileName, dirName) } chartYamlContent, err := os.ReadFile(chartYaml) if err != nil { - return false, errors.Errorf("cannot read %s in directory %q", ChartfileName, dirName) + return false, fmt.Errorf("cannot read %s in directory %q", ChartfileName, dirName) } chartContent := new(chart.Metadata) @@ -82,10 +82,10 @@ func IsChartDir(dirName string) (bool, error) { return false, err } if chartContent == nil { - return false, errors.Errorf("chart metadata (%s) missing", ChartfileName) + return false, fmt.Errorf("chart metadata (%s) missing", ChartfileName) } if chartContent.Name == "" { - return false, errors.Errorf("invalid chart (%s): name must not be empty", ChartfileName) + return false, fmt.Errorf("invalid chart (%s): name must not be empty", ChartfileName) } return true, nil