simplify sock file exists check

This commit is contained in:
strogiyotec 2020-09-06 15:29:48 -07:00
parent adf5d8c4c9
commit 7f85672bca
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ func (s *Server) Stop() {
func NewServer(runner *TaskRunner, config *Config) (*Server, error) { func NewServer(runner *TaskRunner, config *Config) (*Server, error) {
//check if socket file exists //check if socket file exists
if _, err := os.Stat(config.SocketPath); os.IsExist(err) { if _, err := os.Stat(config.SocketPath); err == nil {
_, err := net.Dial("unix", config.SocketPath) _, err := net.Dial("unix", config.SocketPath)
//if error then sock file was saved after crash //if error then sock file was saved after crash
if err != nil { if err != nil {