# Dev-Tools **Repository Path**: CrazyAirhead/dev-tools ## Basic Information - **Project Name**: Dev-Tools - **Description**: Go 语言创建的工具箱。 - **Primary Language**: Go - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-09 - **Last Updated**: 2025-12-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 开发工具箱 一个基于 Fyne 框架开发的跨平台开发工具集合应用。 ## 功能特性 ### 已实现功能 1. **首页** - 以图标方式展示所有可用工具 2. **时间格式转换** - 支持多种时间格式转换功能: - 时间戳转可读时间(自动识别秒级和毫秒级) - 时间字符串转时间戳 - 多种时间格式输出(标准格式、ISO格式、英文格式等) - 实时显示当前时间 - 快捷转换按钮 ### 计划功能 - JSON 格式化工具 - Base64 编码/解码工具 - URL 编码/解码工具 - Hash 生成工具(MD5、SHA1、SHA256等) - UUID 生成器 - 二维码生成器 - 颜色选择器和格式转换 - 正则表达式测试工具 ## 运行环境 - Go 1.16 或更高版本 - 支持 Windows、macOS、Linux ## 安装和运行 ### 1. 克隆项目 ```bash git clone cd dev-tools ``` ### 2. 安装依赖 ```bash go mod tidy ``` ### 3. 运行应用 ```bash go run main.go ``` ### 4. 构建可执行文件 ```bash # 构建当前平台的可执行文件 go build -o dev-tools main.go # 交叉编译(需要安装对应的CGO工具链) # Windows GOOS=windows GOARCH=amd64 go build -o dev-tools.exe main.go # macOS GOOS=darwin GOARCH=amd64 go build -o dev-tools-darwin main.go # Linux GOOS=linux GOARCH=amd64 go build -o dev-tools-linux main.go ``` ## 使用说明 1. **主界面布局**: - 左侧:工具列表导航 - 右侧:选中工具的功能区域 2. **时间格式转换工具**: - 输入时间戳(支持秒级和毫秒级) - 点击"转换时间戳"查看多种格式的时间 - 输入时间字符串,点击"格式化时间"转换为时间戳 - 使用快捷按钮快速获取当前时间 ## 开发说明 ### 项目结构 ``` dev-tools/ ├── main.go # 主程序入口 ├── go.mod # Go 模块文件 ├── go.sum # 依赖锁定文件 ├── tools/ # 工具包目录 │ ├── types.go # 工具类型定义 │ ├── home.go # 首页工具 │ └── timeconverter.go # 时间格式转换工具 ├── README.md # 项目说明文档 └── CLAUDE.md # Claude AI 开发指南 ``` ### 添加新工具 1. 在 `tools/` 目录下创建新的工具文件(如 `newtool.go`) 2. 实现工具的 `GetNewTool()` 函数和功能代码 3. 在 `tools/types.go` 的 `GetAllTools()` 函数中添加新工具 示例工具文件 `tools/newtool.go`: ```go package tools import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/container" ) // GetNewTool 返回新工具定义 func GetNewTool() Tool { return Tool{ ID: "new-tool", Name: "新工具", Icon: theme.SettingsIcon(), Content: func() fyne.CanvasObject { return createNewTool() }, } } // createNewTool 创建新工具的界面 func createNewTool() fyne.CanvasObject { return widget.NewCard("新工具", "", container.NewVBox( widget.NewLabel("这是新工具的内容"), ), ) } ``` 然后在 `tools/types.go` 的 `GetAllTools()` 中添加: ```go func GetAllTools() []Tool { return []Tool{ GetHomeTool(), GetTimeConverterTool(), GetNewTool(), // 添加新工具 } } ``` ## 技术栈 - **语言**: Go - **GUI框架**: Fyne v2 - **架构**: 模块化设计,易于扩展 ## 贡献 欢迎提交 Issue 和 Pull Request 来改进这个项目。 ## 许可证 Apache License 2.0