From 32f3ddef4f98ca7ef5659bc71c139c73c8875c60 Mon Sep 17 00:00:00 2001 From: zhangshu <70257536+Appolli9527@users.noreply.github.com> Date: Thu, 18 Apr 2024 00:12:55 +0800 Subject: [PATCH] fix code style --- youtube_collection_server/main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/youtube_collection_server/main.go b/youtube_collection_server/main.go index ace4605..b6281b8 100644 --- a/youtube_collection_server/main.go +++ b/youtube_collection_server/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" utils "youtube_collection_server/Utils" - . "youtube_collection_server/config" + config "youtube_collection_server/config" "youtube_collection_server/controller" "youtube_collection_server/middle" @@ -11,22 +11,22 @@ import ( ) func main() { - InitConfig() + config.InitConfig() // 创建一个默认的路由引擎 router := gin.Default() //初始化路由 initRouter(router) - Logger.Infof("服务器启动成功...端口:%d", MyEnv.Server.Port) + config.Logger.Infof("服务器启动成功...端口:%d", config.MyEnv.Server.Port) router.Use(middle.Cors()) - err := router.Run(fmt.Sprintf(":"+"%d", MyEnv.Server.Port)) + err := router.Run(fmt.Sprintf(":"+"%d", config.MyEnv.Server.Port)) if err != nil { - Logger.Error("服务器启动失败") + config.Logger.Error("服务器启动失败") return } } func initRouter(router *gin.Engine) { - router.Use(utils.LoggerToFile(MyEnv.Log.LogEnv, MyEnv.Log.LogPath)) + router.Use(utils.LoggerToFile(config.MyEnv.Log.LogEnv, config.MyEnv.Log.LogPath)) noAuth := router.Group("") { noAuth.GET("/test", controller.UserController.Test)