refactor: 删除更多未使用的死代码

- parse.go: 删除 RemoveDuplicate 函数及其测试
- parsers.go: 删除 excludeHosts, removeDuplicates 别名函数
- 更新测试使用真正的函数名
This commit is contained in:
ZacharyZcR
2026-01-21 23:43:07 +08:00
parent f18b51ca92
commit be76e272a5
4 changed files with 9 additions and 415 deletions
-28
View File
@@ -4,34 +4,6 @@ import (
"github.com/shadow1ng/fscan/common/logging"
)
/*
parse.go - 解析相关工具函数
重构后只保留:
- RemoveDuplicate - 字符串去重
- applyLogLevel - 日志级别应用
- 辅助函数
*/
// RemoveDuplicate 去重函数
func RemoveDuplicate(old []string) []string {
if len(old) <= 1 {
return old
}
temp := make(map[string]struct{}, len(old))
result := make([]string, 0, len(old))
for _, item := range old {
if _, exists := temp[item]; !exists {
temp[item] = struct{}{}
result = append(result, item)
}
}
return result
}
// logLevelMap 日志级别字符串到级别的映射
var logLevelMap = map[string]logging.LogLevel{
LogLevelAll: logging.LevelAll,