diff --git a/api/internal/plugins/execplugin/execplugin.go b/api/internal/plugins/execplugin/execplugin.go index 0872abdb3..f6cc0b53f 100644 --- a/api/internal/plugins/execplugin/execplugin.go +++ b/api/internal/plugins/execplugin/execplugin.go @@ -161,12 +161,12 @@ func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) { _, err = f.Write(p.cfg) if err != nil { return nil, errors.WrapPrefixf( - err, "%s", "writing plugin config to "+f.Name()) + err, "writing plugin config to %s", f.Name()) } err = f.Close() if err != nil { return nil, errors.WrapPrefixf( - err, "%s", "closing plugin config file "+f.Name()) + err, "closing plugin config file %s", f.Name()) } cmd := exec.Command( p.path, append([]string{f.Name()}, p.args...)...) diff --git a/kustomize/commands/openapi/fetch/fetch.go b/kustomize/commands/openapi/fetch/fetch.go index b12765a1f..197ac3206 100644 --- a/kustomize/commands/openapi/fetch/fetch.go +++ b/kustomize/commands/openapi/fetch/fetch.go @@ -52,9 +52,9 @@ Installation and setup instructions: https://kubernetes.io/docs/tasks/tools/inst command.Stderr = &stderr err := command.Run() if err != nil { - return fmt.Errorf("%w\n%s", err, stderr.String()+errMsg) + return fmt.Errorf("%w\n%s%s", err, stderr.String(), errMsg) } else if stdout.String() == "" { - return fmt.Errorf("%s", stderr.String()+errMsg) + return fmt.Errorf("%s%s", stderr.String(), errMsg) } // format and output diff --git a/kyaml/filesys/filesystem.go b/kyaml/filesys/filesystem.go index a71f5d074..4e1c3d896 100644 --- a/kyaml/filesys/filesystem.go +++ b/kyaml/filesys/filesystem.go @@ -4,7 +4,6 @@ package filesys import ( - "fmt" "path/filepath" "sigs.k8s.io/kustomize/kyaml/errors" @@ -78,7 +77,7 @@ func ConfirmDir(fSys FileSystem, path string) (ConfirmedDir, error) { return "", errors.WrapPrefixf(err, "not a valid directory") } if f != "" { - return "", errors.WrapPrefixf(errors.Errorf("file is not directory"), "%s", fmt.Sprintf("'%s'", path)) + return "", errors.WrapPrefixf(errors.Errorf("file is not directory"), "'%s'", path) } return d, nil }