I really hate pointers

This commit is contained in:
2020-10-31 00:35:28 -04:00
parent c8ea453f71
commit 67e9fe41c2

View File

@ -5,10 +5,29 @@ import (
"io/ioutil" "io/ioutil"
) )
/*
Game chess.Game
StartTime time.Time
ConvID string
White string
Black string
Move bool
*/
func loadConfig() Config { func loadConfig() Config {
var c Config var c Config
confFile, _ := ioutil.ReadFile(configFile) confFile, _ := ioutil.ReadFile(configFile)
_ = json.Unmarshal([]byte(confFile), &c) _ = json.Unmarshal([]byte(confFile), &c)
for cid, game := range c.Games {
g := game.Game.Clone()
c.Games[cid] = Game{
Game: *g,
StartTime: game.StartTime,
ConvID: game.ConvID,
White: game.White,
Black: game.Black,
Move: game.Move,
}
}
return c return c
} }