-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
40 lines (32 loc) · 948 Bytes
/
main.go
File metadata and controls
40 lines (32 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"github.com/2lovecode/graffito/cmd/cli"
"github.com/2lovecode/graffito/pkg/config"
"github.com/2lovecode/graffito/pkg/logging"
"github.com/spf13/cobra"
)
func main() {
// 初始化日志
logging.Init()
// 加载配置
_, err := config.Load()
if err != nil {
logging.Warnf("配置加载失败,使用默认配置: %v", err)
}
rootCmd := &cobra.Command{
Use: "graffito",
Short: "Graffito - Go开发工具箱",
Long: `Graffito是一个Go开发工具箱,集成常用开发工具和学习资源。
包括:
- 开发工具:沙箱、时序图、图片处理等
- 学习资源:LeetCode题解、算法实现、设计模式等
- 实验功能:实验代码和实践探索
更多信息请访问: https://github.com/2lovecode/graffito
`,
Version: "1.0.0",
}
rootCmd.AddCommand(cli.NewCommand())
if err := rootCmd.Execute(); err != nil {
logging.Fatalf("执行命令失败: %v", err)
}
}