<commit_before>package system


// 定义清理器接口
type ExitCleaner interface {
	ExitClean() error
}

// 定义清理器列表
type CleanList struct {
		
}

//
func (p *CleanList) Add(ec ExitCleaner) error {

}

//
func<commit_msg>update exitcleaner<commit_after>package system

import (
	"errors"

	"golang.org/x/sync/syncmap"
)

// 定义清理器接口
type ExitCleaner interface {
	ExitClean() error
}

// 定义清理器列表
type CleanList struct {
	list *syncmap.Map
}

//
func (p *CleanList) Add(ec ExitCleaner) error {
	_, exist := p.list.Load(ec)
	if exist {
		return errors.New("the key already exists")
	}
	p.list.Store(ec, "")
	return nil
}

//
func (p *CleanList) Run() {
	p.list.Range(runClean)
}

//
func runClean(key interface{}, value interface{}) bool {
	newkey, ok := key.(ExitCleaner)
	if !ok {
		return true
	}
	newkey.ExitClean()
	return true
}
{'fraction_non_alphanumeric': 0.14058679706601468, 'fraction_numerical': 0.0, 'mean_word_length': 3.601123595505618, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5171314', 'n_tokens_mistral': 341, 'n_tokens_neox': 338, 'n_words': 75}