code: func (a *Agent) Shutdown() error {
  	a.shutdownLock.Lock()
  	defer a.shutdownLock.Unlock()
  
  	if a.shutdown {
  		return nil
  	}
  
  	if a.serf == nil {
  		goto EXIT
  	}
  
  	a.logger.Println("[INFO] agent: requesting serf shutdown")
  	if err := a.serf.Shutdown(); err != nil {
  		return err
  	}
  
  EXIT:
  	a.logger.Println("[INFO] agent: shutdown complete")
  	a.shutdown = true
  	close(a.shutdownCh)
  	return nil
  }
docs: // Shutdown closes this agent and all of its processes. Should be preceded
  // by a Leave for a graceful shutdown.