From 1598980f0e749b630f50ad240bfa036795baba8d Mon Sep 17 00:00:00 2001 From: Rudi Date: Sun, 31 Jul 2022 11:19:24 -0400 Subject: [PATCH] go fmt --- main.go | 15 ++++++--------- strings.go | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/main.go b/main.go index 8df290e..5950b5b 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ package main import ( "bufio" "flag" - "fmt" + "fmt" "log" "os" "os/exec" @@ -12,12 +12,12 @@ import ( ) var ( - startup []string - daemon = false + startup []string + daemon = false serviceFile = "/adm/services" services = make(map[string]string) controlSocket = "/adm/headless9/ctl/headless9.ctl" - logPath = "/adm/headless9/log/" + logPath = "/adm/headless9/log/" ) func main() { @@ -45,7 +45,7 @@ func main() { log.Println(err) } fmt.Println(strings.Join(sysTail(10, controlSocket), "\n")) - + } func getCtl() *os.File { @@ -119,12 +119,9 @@ func headlessControls() { log.Printf(DAEMON_PROCESSING_CTL, cmd) } } - - } } - func execCommand(cmd string, arg ...string) { defer PanicSafe() if len(cmd) < 2 { @@ -210,4 +207,4 @@ func sysTail(count int, path string) []string { lines := strings.Split(string(output), "\n") return lines[:len(lines)-1] -} \ No newline at end of file +} diff --git a/strings.go b/strings.go index 6f113ef..fbc68b0 100644 --- a/strings.go +++ b/strings.go @@ -1,16 +1,16 @@ 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" - DAEMON_FILE_REFRESH = "Refreshing controlFile %+v" - DAEMON_SVC_EXISTS = "%+v exists as PID %+v" - DAEMON_SVC_MISSING = "Svc not detected, starting: %+v" + 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" + DAEMON_FILE_REFRESH = "Refreshing controlFile %+v" + DAEMON_SVC_EXISTS = "%+v exists as PID %+v" + DAEMON_SVC_MISSING = "Svc not detected, starting: %+v" DAEMON_PROCESSING_CTL = "Processing command: %+v" - DAEMON_CMD_INVALID = "Invalid command `%v`, skipping. Args: { %+v }" - DAEMON_SVC_FAIL = "Error starting service %+v, see log for more info." -) \ No newline at end of file + DAEMON_CMD_INVALID = "Invalid command `%v`, skipping. Args: { %+v }" + DAEMON_SVC_FAIL = "Error starting service %+v, see log for more info." +)