From 3de964388a4e8c77c22bf11fbad0c2728e008ba9 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 4 Feb 2023 20:48:07 +0400 Subject: [PATCH] A separate errors.go has no sense. --- configuration.go | 5 +++-- errors.go | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-) delete mode 100644 errors.go diff --git a/configuration.go b/configuration.go index b05a18a..06fc0fb 100644 --- a/configuration.go +++ b/configuration.go @@ -2,6 +2,7 @@ package main import ( "bufio" + "errors" "log" "os" "strconv" @@ -74,7 +75,7 @@ func (conf *Configuration) StoreConfiguration(path string) (err error) { func (conf *Configuration) AddProcess(process string, configPath string) error { for _, v := range conf.Processes { if v == process { - return ErrIsOnList + return errors.New("process is already on list") } } @@ -93,5 +94,5 @@ func (conf *Configuration) RemoveProcess(process string, configPath string) erro } } - return ErrNotFound + return errors.New("process is not on list") } diff --git a/errors.go b/errors.go deleted file mode 100644 index 50bc8c4..0000000 --- a/errors.go +++ /dev/null @@ -1,9 +0,0 @@ -package main - -import "errors" - -// ErrNotFound occurs when a process is not presented in a list -var ErrNotFound = errors.New("process is not on list") - -// ErrIsOnList occurs when a process is already presented in a list -var ErrIsOnList = errors.New("process is already on list")