From 159a3562d4b06990a8b8f51f74e1ff5b8a8a268c Mon Sep 17 00:00:00 2001 From: nitezs Date: Sat, 23 Sep 2023 15:12:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=9B=B4=E6=8E=A5=E5=B4=A9=E6=BA=83=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 72e5f58..ed0ff5a 100644 --- a/main.go +++ b/main.go @@ -20,8 +20,14 @@ var templateMeta string var templateClash string func init() { + var err error + // 创建文件夹 + err = utils.MkEssentialDir() + if err != nil { + logger.Logger.Panic("create essential dir failed", zap.Error(err)) + } // 加载配置 - err := config.LoadConfig() + err = config.LoadConfig() // 初始化日志 logger.InitLogger(config.Default.LogLevel) if err != nil { @@ -41,11 +47,6 @@ func init() { } else { logger.Logger.Info("running in dev mode") } - // 创建文件夹 - err = utils.MkEssentialDir() - if err != nil { - logger.Logger.Panic("create essential dir failed", zap.Error(err)) - } // 写入默认模板 err = utils.WriteDefalutTemplate(templateMeta, templateClash) if err != nil {