fscan/main.go
ZacharyZcR 05ba01f170 refactor: 统一包命名规范并清理冗余文件
主要更改:
- 统一包目录命名为小写(Core→core, Plugins→plugins, WebScan→webscan)
- 更新所有import路径以符合Go语言命名规范
- 重构parsers模块,简化复杂的工厂模式(从2000+行优化至400行)
- 移除i18n兼容层,统一使用模块化i18n包
- 简化Core/Manager.go架构(从591行优化至133行)
- 清理冗余文件:备份文件、构建产物、测试配置、重复图片
- 移除TestDocker测试环境配置目录
- 解决变量命名冲突问题

性能优化:
- 减少代码复杂度60-70%
- 提升构建和运行性能
- 保持完整功能兼容性

代码质量:
- 符合Go语言最佳实践
- 统一命名规范
- 优化项目结构
2025-08-06 01:30:18 +08:00

33 lines
608 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"fmt"
"os"
"github.com/shadow1ng/fscan/common"
"github.com/shadow1ng/fscan/core"
)
func main() {
var Info common.HostInfo
common.Flag(&Info)
// 在flag解析后初始化logger确保LogLevel参数生效
common.InitLogger()
// 解析 CLI 参数
if err := common.Parse(&Info); err != nil {
os.Exit(1)
}
// 初始化输出系统,如果失败则直接退出
if err := common.InitOutput(); err != nil {
common.LogError(fmt.Sprintf("初始化输出系统失败: %v", err))
os.Exit(1)
}
defer common.CloseOutput()
// 执行 CLI 扫描逻辑
core.Scan(Info)
}