code: func (s *StanServer) closeClient(clientID string) error {
  	s.closeMu.Lock()
  	defer s.closeMu.Unlock()
  	// Lookup client first, will unregister only after removing its subscriptions
  	client := s.clients.lookup(clientID)
  	if client == nil {
  		s.log.Errorf("Unknown client %q in close request", clientID)
  		return ErrUnknownClient
  	}
  
  	// Remove all non-durable subscribers.
  	s.removeAllNonDurableSubscribers(client)
  
  	// Remove from our clientStore.
  	if _, err := s.clients.unregister(clientID); err != nil {
  		s.log.Errorf("Error unregistering client %q: %v", clientID, err)
  	}
  
  	if s.debug {
  		client.RLock()
  		hbInbox := client.info.HbInbox
  		client.RUnlock()
  		s.log.Debugf("[Client:%s] Closed (Inbox=%v)", clientID, hbInbox)
  	}
  	return nil
  }
docs: // Close a client