refactor(common): 删除死代码,优化代码风格

- 删除未使用的 joinStrings/joinInts 函数
- 删除未使用的 memStats 字段和 getMemoryInfo 方法
- 简化 parsePasswords 中的循环为 append(...) 形式
This commit is contained in:
ZacharyZcR
2026-01-21 21:18:26 +08:00
parent 26cf7dbb37
commit df724195e2
3 changed files with 3 additions and 63 deletions
-20
View File
@@ -1,9 +1,6 @@
package common
import (
"strconv"
"strings"
"github.com/shadow1ng/fscan/common/logging"
)
@@ -35,23 +32,6 @@ func RemoveDuplicate(old []string) []string {
return result
}
// joinStrings 连接字符串切片
func joinStrings(slice []string, sep string) string {
return strings.Join(slice, sep)
}
// joinInts 连接整数切片
func joinInts(slice []int, sep string) string {
if len(slice) == 0 {
return ""
}
strs := make([]string, len(slice))
for i, v := range slice {
strs[i] = strconv.Itoa(v)
}
return strings.Join(strs, sep)
}
// logLevelMap 日志级别字符串到级别的映射
var logLevelMap = map[string]logging.LogLevel{
LogLevelAll: logging.LevelAll,