use fmt pkg to replace errors.Errorf in load_plugins

Signed-off-by: James Sheppard <jgsheppa@protonmail.com>
pull/12063/head
James Sheppard 2 years ago
parent 13506b57bb
commit 1daa94e403

@ -27,7 +27,6 @@ import (
"strings" "strings"
"syscall" "syscall"
"github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"sigs.k8s.io/yaml" "sigs.k8s.io/yaml"
@ -87,7 +86,7 @@ func loadPlugins(baseCmd *cobra.Command, out io.Writer) {
main, argv, prepCmdErr := plug.PrepareCommand(u) main, argv, prepCmdErr := plug.PrepareCommand(u)
if prepCmdErr != nil { if prepCmdErr != nil {
os.Stderr.WriteString(prepCmdErr.Error()) os.Stderr.WriteString(prepCmdErr.Error())
return errors.Errorf("plugin %q exited with error", md.Name) return fmt.Errorf("plugin %q exited with error", md.Name)
} }
return callPluginExecutable(md.Name, main, argv, out) return callPluginExecutable(md.Name, main, argv, out)
@ -138,7 +137,7 @@ func callPluginExecutable(pluginName string, main string, argv []string, out io.
os.Stderr.Write(eerr.Stderr) os.Stderr.Write(eerr.Stderr)
status := eerr.Sys().(syscall.WaitStatus) status := eerr.Sys().(syscall.WaitStatus)
return pluginError{ return pluginError{
error: errors.Errorf("plugin %q exited with error", pluginName), error: fmt.Errorf("plugin %q exited with error", pluginName),
code: status.ExitStatus(), code: status.ExitStatus(),
} }
} }

Loading…
Cancel
Save