code: func (s *Service) Run(c context.Context, f func(context.Context) error) {
  	// Log to Stdout using JSON log lines.
  	c = teelogger.Use(c, gkelogger.GetFactory(os.Stdout))
  
  	// If a service name isn't specified, default to the base of the current
  	// executable.
  	if s.Name == "" {
  		s.Name = filepath.Base(os.Args[0])
  	}
  	s.useDatastoreConfig = true // If available, use datastore config.
  
  	rc := 0
  	if err := s.runImpl(c, f); err != nil {
  		log.WithError(err).Errorf(c, "Application exiting with error.")
  		rc = 1
  	}
  	os.Exit(rc)
  }
docs: // Run performs service-wide initialization and invokes the specified run
  // function.