From 3134a937ab5133d73c799618f2a53e21e7c8a460 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 1 Dec 2017 13:18:52 -0300 Subject: [PATCH] 10666: Formatting fixes. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- services/arv-git-httpd/main.go | 6 +++--- services/crunch-dispatch-local/crunch-dispatch-local.go | 6 +++--- services/crunch-dispatch-slurm/crunch-dispatch-slurm.go | 6 +++--- services/crunch-run/crunchrun.go | 6 +++--- services/crunchstat/crunchstat.go | 6 +++--- services/health/main.go | 7 +++---- services/keep-balance/main.go | 6 +++--- services/keep-web/main.go | 6 +++--- services/keepproxy/keepproxy.go | 6 +++--- services/keepstore/keepstore.go | 6 +++--- services/ws/main.go | 9 +++------ 11 files changed, 33 insertions(+), 37 deletions(-) diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go index 76aacc4e9d..74ac7ae55e 100644 --- a/services/arv-git-httpd/main.go +++ b/services/arv-git-httpd/main.go @@ -63,8 +63,8 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("arv-git-httpd %s\n", version) + return } err := config.LoadFile(theConfig, *cfgPath) @@ -94,7 +94,7 @@ func main() { if _, err := daemon.SdNotify(false, "READY=1"); err != nil { log.Printf("Error notifying init daemon: %v", err) } - log.Printf("arv-git-httpd %q started", version) + log.Printf("arv-git-httpd %s started", version) log.Println("Listening at", srv.Addr) log.Println("Repository root", theConfig.RepoRoot) if err := srv.Wait(); err != nil { diff --git a/services/crunch-dispatch-local/crunch-dispatch-local.go b/services/crunch-dispatch-local/crunch-dispatch-local.go index 1529c4fbab..279327ba18 100644 --- a/services/crunch-dispatch-local/crunch-dispatch-local.go +++ b/services/crunch-dispatch-local/crunch-dispatch-local.go @@ -62,11 +62,11 @@ func doMain() error { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("crunch-dispatch-local %s\n", version) + return nil } - log.Printf("crunch-dispatch-local %q started", version) + log.Printf("crunch-dispatch-local %s started", version) runningCmds = make(map[string]*exec.Cmd) diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go index 5eeb32e62f..d322b0f3f6 100644 --- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go +++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go @@ -80,11 +80,11 @@ func doMain() error { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("crunch-dispatch-slurm %s\n", version) + return nil } - log.Printf("crunch-dispatch-slurm %q started", version) + log.Printf("crunch-dispatch-slurm %s started", version) err := readConfig(&theConfig, *configPath) if err != nil { diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go index a957874f91..02ac872a6f 100644 --- a/services/crunch-run/crunchrun.go +++ b/services/crunch-run/crunchrun.go @@ -1601,11 +1601,11 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("crunch-run %s\n", version) + return } - log.Printf("crunch-run %q started", version) + log.Printf("crunch-run %s started", version) containerId := flag.Arg(0) diff --git a/services/crunchstat/crunchstat.go b/services/crunchstat/crunchstat.go index 248ec6259d..ad433bb3b5 100644 --- a/services/crunchstat/crunchstat.go +++ b/services/crunchstat/crunchstat.go @@ -44,11 +44,11 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("crunchstat %s\n", version) + return } - reporter.Logger.Printf("crunchstat %q started", version) + reporter.Logger.Printf("crunchstat %s started", version) if reporter.CgroupRoot == "" { reporter.Logger.Fatal("error: must provide -cgroup-root") diff --git a/services/health/main.go b/services/health/main.go index 4b553659ed..496fb884d4 100644 --- a/services/health/main.go +++ b/services/health/main.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "os" "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/health" @@ -21,14 +20,14 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("arvados-health %s\n", version) + return } log.SetFormatter(&log.JSONFormatter{ TimestampFormat: "2006-01-02T15:04:05.000000000Z07:00", }) - log.Printf("arvados health %q started", version) + log.Printf("arvados-health %s started", version) cfg, err := arvados.GetConfig(*configFile) if err != nil { diff --git a/services/keep-balance/main.go b/services/keep-balance/main.go index ecc3f2696f..947033564d 100644 --- a/services/keep-balance/main.go +++ b/services/keep-balance/main.go @@ -94,8 +94,8 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("keep-balance %s\n", version) + return } mustReadConfig(&cfg, *configPath) @@ -107,7 +107,7 @@ func main() { log.Fatal(config.DumpAndExit(cfg)) } - log.Printf("keep-balance %q started", version) + log.Printf("keep-balance %s started", version) if *debugFlag { debugf = log.Printf diff --git a/services/keep-web/main.go b/services/keep-web/main.go index 938377b525..724af27c7e 100644 --- a/services/keep-web/main.go +++ b/services/keep-web/main.go @@ -94,8 +94,8 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("keep-web %s\n", version) + return } if err := config.LoadFile(cfg, configPath); err != nil { @@ -115,7 +115,7 @@ func main() { log.Fatal(config.DumpAndExit(cfg)) } - log.Printf("keep-web %q started", version) + log.Printf("keep-web %s started", version) os.Setenv("ARVADOS_API_HOST", cfg.Client.APIHost) srv := &server{Config: cfg} diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go index 59eec0bb04..23a22a86a3 100644 --- a/services/keepproxy/keepproxy.go +++ b/services/keepproxy/keepproxy.go @@ -81,8 +81,8 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("keepproxy %s\n", version) + return } err := config.LoadFile(cfg, cfgPath) @@ -108,7 +108,7 @@ func main() { log.Fatal(config.DumpAndExit(cfg)) } - log.Printf("keepproxy %q started", version) + log.Printf("keepproxy %s started", version) arv, err := arvadosclient.New(&cfg.Client) if err != nil { diff --git a/services/keepstore/keepstore.go b/services/keepstore/keepstore.go index 06a26984d0..f3d30d9831 100644 --- a/services/keepstore/keepstore.go +++ b/services/keepstore/keepstore.go @@ -105,8 +105,8 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("keepstore %s\n", version) + return } deprecated.afterFlagParse(theConfig) @@ -120,7 +120,7 @@ func main() { log.Fatal(config.DumpAndExit(theConfig)) } - log.Printf("keepstore %q started", version) + log.Printf("keepstore %s started", version) err = theConfig.Start() if err != nil { diff --git a/services/ws/main.go b/services/ws/main.go index df462eafc2..a0006a4f8a 100644 --- a/services/ws/main.go +++ b/services/ws/main.go @@ -7,7 +7,6 @@ package main import ( "flag" "fmt" - "os" "git.curoverse.com/arvados.git/sdk/go/config" "git.curoverse.com/arvados.git/sdk/go/ctxlog" @@ -27,8 +26,8 @@ func main() { // Print version information if requested if *getVersion { - fmt.Printf("Version: %s\n", version) - os.Exit(0) + fmt.Printf("arvados-ws %s\n", version) + return } err := config.LoadFile(&cfg, *configPath) @@ -48,9 +47,7 @@ func main() { return } - log.Printf("arvados-ws %q started", version) - - log.Info("started") + log.Printf("arvados-ws %s started", version) srv := &server{wsConfig: &cfg} log.Fatal(srv.Run()) } -- 2.30.2