From 67e9fe41c29967491036f0917e4868092e443fc5 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Sat, 31 Oct 2020 00:35:28 -0400 Subject: [PATCH] I really hate pointers --- config.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/config.go b/config.go index d2c22aa..17a7c2e 100644 --- a/config.go +++ b/config.go @@ -5,10 +5,29 @@ import ( "io/ioutil" ) +/* + Game chess.Game + StartTime time.Time + ConvID string + White string + Black string + Move bool +*/ func loadConfig() Config { var c Config confFile, _ := ioutil.ReadFile(configFile) _ = 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 }