mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-21 06:21:43 +00:00
Remove error return from constructor.
This commit is contained in:
@@ -44,15 +44,19 @@ type ExecPlugin struct {
|
||||
h *resmap.PluginHelpers
|
||||
}
|
||||
|
||||
func NewExecPlugin(p string) (*ExecPlugin, error) {
|
||||
f, err := os.Stat(p)
|
||||
func NewExecPlugin(p string) *ExecPlugin {
|
||||
return &ExecPlugin{path: p}
|
||||
}
|
||||
|
||||
func (p *ExecPlugin) ErrIfNotExecutable() error {
|
||||
f, err := os.Stat(p.path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return err
|
||||
}
|
||||
if f.Mode()&0111 == 0000 {
|
||||
return nil, fmt.Errorf("unable to execute plugin on path: %s", p)
|
||||
return fmt.Errorf("unexecutable plugin at: %s", p.path)
|
||||
}
|
||||
return &ExecPlugin{path: p}, nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *ExecPlugin) Path() string {
|
||||
|
||||
Reference in New Issue
Block a user