mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-23 03:31:53 +08:00
refactor(common): 删除死代码,优化代码风格
- 删除未使用的 joinStrings/joinInts 函数 - 删除未使用的 memStats 字段和 getMemoryInfo 方法 - 简化 parsePasswords 中的循环为 append(...) 形式
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user