code: func (s *Store) Close() (lastIdx uint64, err error) {
  	// Notify goroutines of closing and wait until they finish.
  	close(s.closing)
  	s.wg.Wait()
  	s.mu.Lock()
  	defer s.mu.Unlock()
  
  	for _, l := range s.subscribers {
  		for el := l.Front(); el != nil; el = el.Next() {
  			go el.Value.(*subscription).Close()
  		}
  	}
  	if s.raft != nil {
  		s.raft.Shutdown().Error()
  		lastIdx = s.raft.LastIndex()
  		s.raft = nil
  	}
  	if s.transport != nil {
  		s.transport.Close()
  		s.transport = nil
  	}
  	if s.stableStore != nil {
  		s.stableStore.Close()
  		s.stableStore = nil
  	}
  
  	return lastIdx, nil
  }
docs: // Close shuts down the transport and store.