clean up code and print Version instead of Build

This commit is contained in:
Slack Security Team 2019-11-28 16:25:34 +00:00
parent 3fe99aa065
commit a5814be1ca
2 changed files with 2 additions and 6 deletions

View File

@ -25,7 +25,7 @@ func main() {
flag.Parse() flag.Parse()
if *printVersion { if *printVersion {
fmt.Printf("Build: %s\n", Build) fmt.Printf("Version: %s\n", Build)
os.Exit(0) os.Exit(0)
} }

View File

@ -21,8 +21,7 @@ type program struct {
func (p *program) Start(s service.Service) error { func (p *program) Start(s service.Service) error {
logger.Info("Nebula service starting.") logger.Info("Nebula service starting.")
p.exit = make(chan struct{}) p.exit = make(chan struct{})
// Start should not block.
// Start should not block. Do the actual work async.
go p.run() go p.run()
return nil return nil
} }
@ -33,7 +32,6 @@ func (p *program) run() error {
} }
func (p *program) Stop(s service.Service) 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.") logger.Info("Nebula service stopping.")
close(p.exit) close(p.exit)
return nil return nil
@ -82,7 +80,6 @@ func doService(configPath *string, configTest *bool, build string, serviceFlag *
} }
}() }()
//if len(*serviceFlag) != 0 {
switch *serviceFlag { switch *serviceFlag {
case "run": case "run":
err = s.Run() err = s.Run()
@ -96,7 +93,6 @@ func doService(configPath *string, configTest *bool, build string, serviceFlag *
log.Fatal(err) log.Fatal(err)
} }
return return
//}
} }
} }