add save game

This commit is contained in:
shoopea
2025-12-14 13:37:46 +01:00
parent 162a59b665
commit 8554b4ea2a
3 changed files with 38 additions and 11 deletions

View File

@@ -4,7 +4,7 @@ import (
_ "embed"
"encoding/json"
"image/color"
"io/ioutil"
"os"
"time"
"github.com/tidwall/pretty"
@@ -74,7 +74,7 @@ func (c *Config) Load(path string) error {
return err
}
b, err := ioutil.ReadFile(path)
b, err := os.ReadFile(path)
if err != nil {
return c.Save(path)
}
@@ -94,7 +94,7 @@ func (c *Config) Save(path string) error {
return nil
}
err = ioutil.WriteFile(path, b, 0644)
err = os.WriteFile(path, b, 0644)
return err
}