格式化代码

This commit is contained in:
huangxiaolei
2022-12-19 13:40:04 +08:00
parent f773ba8df7
commit 58b2df2bc6
92 changed files with 682 additions and 626 deletions

View File

@@ -57,7 +57,7 @@ func (g *GameDataConfig) loadOpenConfig() {
dirPath := g.binPrefix + v
fileList, err := os.ReadDir(dirPath)
if err != nil {
logger.LOG.Error("open dir error: %v", err)
logger.Error("open dir error: %v", err)
return
}
for _, file := range fileList {
@@ -68,12 +68,12 @@ func (g *GameDataConfig) loadOpenConfig() {
config := make(map[string][]*OpenConfigData)
fileData, err := os.ReadFile(dirPath + "/" + fileName)
if err != nil {
logger.LOG.Error("open file error: %v", err)
logger.Error("open file error: %v", err)
continue
}
err = json.Unmarshal(fileData, &config)
if err != nil {
logger.LOG.Error("parse file error: %v", err)
logger.Error("parse file error: %v", err)
continue
}
for kk, vv := range config {
@@ -83,11 +83,11 @@ func (g *GameDataConfig) loadOpenConfig() {
}
}
if len(list) == 0 {
logger.LOG.Error("no open config entries load")
logger.Error("no open config entries load")
}
g.OpenConfigEntries = make(map[string]*OpenConfigEntry)
for _, v := range list {
g.OpenConfigEntries[v.Name] = v
}
logger.LOG.Info("load %v OpenConfig", len(g.OpenConfigEntries))
logger.Info("load %v OpenConfig", len(g.OpenConfigEntries))
}