配置文件读取
This commit is contained in:
parent
e4ad946560
commit
ed3db69b46
|
|
@ -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" // 默认端口
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue