配置文件读取

This commit is contained in:
lijun 2025-01-14 15:53:39 +08:00
parent e4ad946560
commit ed3db69b46
1 changed files with 2 additions and 1 deletions

View File

@ -68,7 +68,8 @@ func ReadConfig(path string) error {
decoder := json.NewDecoder(file) decoder := json.NewDecoder(file)
err = decoder.Decode(&Config) err = decoder.Decode(&Config)
if err != nil { if err != nil {
fmt.Println("Error decoding config") fmt.Println("Error decoding config:", err)
return err
} else { } else {
if Config.SERVER_PORT == "" { if Config.SERVER_PORT == "" {
Config.SERVER_PORT = "5002" // 默认端口 Config.SERVER_PORT = "5002" // 默认端口