Skip to content

Commit

Permalink
opt: 调整Viper配置文件路径展示代码
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelmaxQm committed Jul 25, 2024
1 parent e593ec6 commit 0fc43fc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/core/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ func Viper(path ...string) *viper.Viper {
switch gin.Mode() {
case gin.DebugMode:
config = internal.ConfigDefaultFile
fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.Mode(), internal.ConfigDefaultFile)
case gin.ReleaseMode:
config = internal.ConfigReleaseFile
fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.Mode(), internal.ConfigReleaseFile)
case gin.TestMode:
config = internal.ConfigTestFile
fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.Mode(), internal.ConfigTestFile)
}
fmt.Printf("您正在使用gin模式的%s环境名称,config的路径为%s\n", gin.Mode(), config)
} else { // internal.ConfigEnv 常量存储的环境变量不为空 将值赋值于config
config = configEnv
fmt.Printf("您正在使用%s环境变量,config的路径为%s\n", internal.ConfigEnv, config)
Expand Down

0 comments on commit 0fc43fc

Please sign in to comment.