mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-24 12:11:52 +08:00
refactor(common): 删除死代码,优化代码风格
- 删除未使用的 joinStrings/joinInts 函数 - 删除未使用的 memStats 字段和 getMemoryInfo 方法 - 简化 parsePasswords 中的循环为 append(...) 形式
This commit is contained in:
@@ -121,9 +121,7 @@ func parsePasswords(fv *FlagVars) []string {
|
||||
|
||||
// 命令行密码
|
||||
if fv.Password != "" {
|
||||
for _, p := range strings.Split(fv.Password, ",") {
|
||||
passwords = append(passwords, p)
|
||||
}
|
||||
passwords = append(passwords, strings.Split(fv.Password, ",")...)
|
||||
}
|
||||
|
||||
// 从文件读取
|
||||
@@ -135,9 +133,7 @@ func parsePasswords(fv *FlagVars) []string {
|
||||
|
||||
// 额外密码
|
||||
if fv.AddPasswords != "" {
|
||||
for _, p := range strings.Split(fv.AddPasswords, ",") {
|
||||
passwords = append(passwords, p)
|
||||
}
|
||||
passwords = append(passwords, strings.Split(fv.AddPasswords, ",")...)
|
||||
}
|
||||
|
||||
return removeDuplicate(passwords)
|
||||
|
||||
Reference in New Issue
Block a user