code: func (e *EncryptedRaftLogger) Clear(ctx context.Context) error {
  	e.encoderMu.Lock()
  	defer e.encoderMu.Unlock()
  
  	if e.wal != nil {
  		if err := e.wal.Close(); err != nil {
  			log.G(ctx).WithError(err).Error("error closing raft WAL")
  		}
  	}
  	e.snapshotter = nil
  
  	os.RemoveAll(e.walDir())
  	os.RemoveAll(e.snapDir())
  	return nil
  }
docs: // Clear closes the existing WAL and removes the WAL and snapshot.