<commit_before>package raft

// ApplyFuture is used to represent an application that may occur in the future
type ApplyFuture interface {
	Error() error
}

// errorFuture is used to return a static error
type errorFuture struct {
	err error
}

func (e errorFuture) Error() error {
	return e.err
}

// logFuture is used to apply a log entry and waits until
// the log is considered committed
type logFuture struct {
	log   Log
	err   error
	errCh chan error
}

func (l *logFuture) Error() error {
	if l.err != nil {
		return l.err
	}
	l.err = <-l.errCh
	return l.err
}

func (l *logFuture) respond(err error) {
	l.errCh <- err
	close(l.errCh)
}<commit_msg>logFuture can be used with nil errCh<commit_after>package raft

// ApplyFuture is used to represent an application that may occur in the future
type ApplyFuture interface {
	Error() error
}

// errorFuture is used to return a static error
type errorFuture struct {
	err error
}

func (e errorFuture) Error() error {
	return e.err
}

// logFuture is used to apply a log entry and waits until
// the log is considered committed
type logFuture struct {
	log   Log
	err   error
	errCh chan error
}

func (l *logFuture) Error() error {
	if l.err != nil {
		return l.err
	}
	l.err = <-l.errCh
	return l.err
}

func (l *logFuture) respond(err error) {
	if l.errCh == nil {
		return
	}
	l.errCh <- err
	close(l.errCh)
}
{'fraction_non_alphanumeric': 0.08857979502196194, 'fraction_numerical': 0.0, 'mean_word_length': 3.2852664576802506, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5138638', 'n_tokens_mistral': 466, 'n_tokens_neox': 451, 'n_words': 186}