code: func main() {
  	svcFlag := flag.String("service", "", "Control the system service.")
  	flag.Parse()
  
  	svcConfig := &service.Config{
  		Name:        "GoServiceExampleLogging",
  		DisplayName: "Go Service Example for Logging",
  		Description: "This is an example Go service that outputs log messages.",
  		Dependencies: []string{
  			"Requires=network.target",
  			"After=network-online.target syslog.target"},
  	}
  
  	prg := &program{}
  	s, err := service.New(prg, svcConfig)
  	if err != nil {
  		log.Fatal(err)
  	}
  	errs := make(chan error, 5)
  	logger, err = s.Logger(errs)
  	if err != nil {
  		log.Fatal(err)
  	}
  
  	go func() {
  		for {
  			err := <-errs
  			if err != nil {
  				log.Print(err)
  			}
  		}
  	}()
  
  	if len(*svcFlag) != 0 {
  		err := service.Control(s, *svcFlag)
  		if err != nil {
  			log.Printf("Valid actions: %q\n", service.ControlAction)
  			log.Fatal(err)
  		}
  		return
  	}
  	err = s.Run()
  	if err != nil {
  		logger.Error(err)
  	}
  }
docs: // Service setup.
  //   Define service config.
  //   Create the service.
  //   Setup the logger.
  //   Handle service controls (optional).
  //   Run the service.