A separate errors.go has no sense.
This commit is contained in:
parent
242fa48358
commit
3de964388a
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -74,7 +75,7 @@ func (conf *Configuration) StoreConfiguration(path string) (err error) {
|
|||||||
func (conf *Configuration) AddProcess(process string, configPath string) error {
|
func (conf *Configuration) AddProcess(process string, configPath string) error {
|
||||||
for _, v := range conf.Processes {
|
for _, v := range conf.Processes {
|
||||||
if v == process {
|
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")
|
||||||
}
|
}
|
||||||
|
@ -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")
|
|
Loading…
Reference in New Issue
Block a user