diff options
author | Julien Dessaux | 2021-11-17 10:30:17 +0100 |
---|---|---|
committer | Julien Dessaux | 2021-11-17 10:30:17 +0100 |
commit | eff9c0c8c6d32c2060841a9b9b98d9d4b38540b2 (patch) | |
tree | af77a8d0867dc11dfa9130a0bba509b6b55b8246 /pkg/config/command.go | |
parent | Refactored package structure (diff) | |
download | shell-game-launcher-master.tar.gz shell-game-launcher-master.tar.bz2 shell-game-launcher-master.zip |
Diffstat (limited to '')
-rw-r--r-- | pkg/config/command.go | 13 |
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 } |