From e306881d6566488fa28a21bade5311c70a65a32d Mon Sep 17 00:00:00 2001 From: Ivan Klymenchenko Date: Sat, 9 Jan 2021 19:07:19 +0200 Subject: [PATCH] Move errors to commander.go --- commander.go | 10 ++++++++++ errors.go | 12 ------------ 2 files changed, 10 insertions(+), 12 deletions(-) delete mode 100644 errors.go diff --git a/commander.go b/commander.go index abd3b89..391f34a 100644 --- a/commander.go +++ b/commander.go @@ -1,11 +1,21 @@ package main import ( + "fmt" "log" "os/exec" "strings" ) +type ShellError struct { + Command string + Err error +} + +func (e *ShellError) Error() string { + return fmt.Sprintf("Cannot run %q. Error %v", e.Command, e.Err) +} + type Commander interface { Exec(cmd *exec.Cmd) (string, error) ExecSilently(cmd *exec.Cmd) error diff --git a/errors.go b/errors.go deleted file mode 100644 index 1ca774e..0000000 --- a/errors.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import "fmt" - -type ShellError struct { - Command string - Err error -} - -func (e *ShellError) Error() string { - return fmt.Sprintf("Cannot run %q. Error %v", e.Command, e.Err) -}