From aba9b67e9a8ee2812f83672568fda848038b5dc8 Mon Sep 17 00:00:00 2001 From: Rudi Date: Sun, 23 Oct 2022 00:16:20 -0400 Subject: [PATCH] Go fmt --- main.go | 22 +++++++++++----------- strings.go | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/main.go b/main.go index c1134ac..c1aa46b 100644 --- a/main.go +++ b/main.go @@ -144,17 +144,17 @@ func processCommand(cmd string) error { start := time.Now() if verb == "restart" || verb == "stop" { f, err := os.OpenFile(fmt.Sprintf("/proc/%d/ctl", services[svc].ProcessHandle.Pid), os.O_WRONLY, 0660) - if err != nil { - log.Printf("") - } - defer f.Close() - _, err = f.WriteString("kill") - if err != nil { - log.Printf(DAEMON_CTL_FAILED, err, time.Since(start)) - } else { - delete(services, svc) - log.Printf(DAEMON_CTL_PROCESSED, svc, time.Since(start)) - } + if err != nil { + log.Printf("") + } + defer f.Close() + _, err = f.WriteString("kill") + if err != nil { + log.Printf(DAEMON_CTL_FAILED, err, time.Since(start)) + } else { + delete(services, svc) + log.Printf(DAEMON_CTL_PROCESSED, svc, time.Since(start)) + } } if verb == "restart" || verb == "start" { startup, err := readLines(serviceFile) diff --git a/strings.go b/strings.go index de5a372..0eef8e1 100644 --- a/strings.go +++ b/strings.go @@ -3,10 +3,10 @@ package main var ( DAEMON_START = "Starting headless9" CMD_SYNTAX = "Command structure: \"headless9 $verb $service\"" - CTL_UNABLE_WRITE = "Unable to write to Control Socket. Please check the file %+v and that it's permissions are 700" - CTL_NOT_OPEN = "Unable to open Control Socket. Please check the file %+v and that it's permissions are 700" - CTL_NOT_CLEAR = "Unable to clear Control Socket. Please check the file %+v and that it's permissions are 700" - CTL_NOT_REWOUND = "Unable to rewind Control Socket. Please check the file %+v and that it's permissions are 700" + CTL_UNABLE_WRITE = "Unable to write to Control Socket. Please check the file %+v and that it's permissions are 660" + CTL_NOT_OPEN = "Unable to open Control Socket. Please check the file %+v and that its permissions are 660" + CTL_NOT_CLEAR = "Unable to clear Control Socket. Please check the file %+v and that its permissions are 660" + CTL_NOT_REWOUND = "Unable to rewind Control Socket. Please check the file %+v and that its permissions are 660" DAEMON_FILE_REFRESH = "Refreshing controlFile %+v" DAEMON_SVC_INVALID = "Invalid command `%v`, skipping. Args: { %+v }" DAEMON_SVC_DISABLED = "%+v is disabled, skipping!"