aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/config/command.go')
-rw-r--r--pkg/config/command.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/pkg/config/command.go b/pkg/config/command.go
index 34142cd..ad19142 100644
--- a/pkg/config/command.go
+++ b/pkg/config/command.go
@@ -1,9 +1,8 @@
package config
import (
+ "fmt"
"strings"
-
- "github.com/pkg/errors"
)
func validateCommand(cmd string) error {
@@ -11,22 +10,22 @@ func validateCommand(cmd string) error {
switch tokens[0] {
case "cp":
if len(tokens) != 3 {
- return errors.New("cp command takes exactly two arguments")
+ return fmt.Errorf("cp command takes exactly two arguments")
}
case "exec":
if len(tokens) <= 1 {
- return errors.New("exec command needs arguments")
+ return fmt.Errorf("exec command needs arguments")
}
case "mkdir":
if len(tokens) != 2 {
- return errors.New("mkdir command takes exactly one argument")
+ return fmt.Errorf("mkdir command takes exactly one argument")
}
case "wait":
if len(tokens) != 1 {
- return errors.New("wait command takes no arguments")
+ return fmt.Errorf("wait command takes no arguments")
}
default:
- return errors.New("Invalid command : " + tokens[0])
+ return fmt.Errorf("Invalid command : " + tokens[0])
}
return nil
}