Pārlūkot izejas kodu

clean up code and print Version instead of Build

Slack Security Team 5 gadi atpakaļ
vecāks
revīzija
a5814be1ca
2 mainītis faili ar 2 papildinājumiem un 6 dzēšanām
  1. 1 1
      cmd/nebula-service/main.go
  2. 1 5
      cmd/nebula-service/service.go

+ 1 - 1
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)
 	}
 

+ 1 - 5
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
-		//}
 	}
 
 }