From a5814be1ca3c3a45d53191c1468c1a4f4e54406b Mon Sep 17 00:00:00 2001 From: Slack Security Team Date: Thu, 28 Nov 2019 16:25:34 +0000 Subject: [PATCH] clean up code and print Version instead of Build --- cmd/nebula-service/main.go | 2 +- cmd/nebula-service/service.go | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/nebula-service/main.go b/cmd/nebula-service/main.go index 8b999fd..7e0634e 100644 --- a/cmd/nebula-service/main.go +++ b/cmd/nebula-service/main.go @@ -25,7 +25,7 @@ func main() { flag.Parse() if *printVersion { - fmt.Printf("Build: %s\n", Build) + fmt.Printf("Version: %s\n", Build) os.Exit(0) } diff --git a/cmd/nebula-service/service.go b/cmd/nebula-service/service.go index 912202c..5d88160 100644 --- a/cmd/nebula-service/service.go +++ b/cmd/nebula-service/service.go @@ -21,8 +21,7 @@ type program struct { func (p *program) Start(s service.Service) error { logger.Info("Nebula service starting.") p.exit = make(chan struct{}) - - // Start should not block. Do the actual work async. + // Start should not block. go p.run() return nil } @@ -33,7 +32,6 @@ func (p *program) run() error { } func (p *program) Stop(s service.Service) error { - // Any work in Stop should be quick, usually a few seconds at most. logger.Info("Nebula service stopping.") close(p.exit) return nil @@ -82,7 +80,6 @@ func doService(configPath *string, configTest *bool, build string, serviceFlag * } }() - //if len(*serviceFlag) != 0 { switch *serviceFlag { case "run": err = s.Run() @@ -96,7 +93,6 @@ func doService(configPath *string, configTest *bool, build string, serviceFlag * log.Fatal(err) } return - //} } }