feat: 读取不同环境配置文件

This commit is contained in:
Blizzard
2025-04-24 21:54:49 +08:00
parent 991f37b13a
commit 1de88e2dac
13 changed files with 155 additions and 32 deletions
+5 -2
View File
@@ -3,9 +3,12 @@ package main
import (
"fmt"
"sundynix-go/core"
"sundynix-go/global"
)
func main() {
cfg := core.Viper()
fmt.Println(cfg.DB)
//初始化viper
global.Viper = core.Viper()
fmt.Println(global.Config.Mysql)
fmt.Println(global.Config.Redis)
}