aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortyropro <[email protected]>2026-04-30 13:18:05 +0100
committertyropro <[email protected]>2026-04-30 13:20:51 +0100
commitac2d210cd139ee7f84182ec4351a35cf245a9fa8 (patch)
tree817b91975bf9ed28157b427a0daa6fb27880c67a
parentb933019e1b5efef72f6c985f3b7bd9eeb36d6512 (diff)
refactor: changed getting state file path in save state to new function
-rw-r--r--state.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/state.go b/state.go
index 81c3e56..ebf634e 100644
--- a/state.go
+++ b/state.go
@@ -26,15 +26,12 @@ func save_state_endpoint(lobby_manager *LobbyManager) gin.HandlerFunc {
return
}
- // get the current working directory
- dir, err := os.Getwd()
+ state_file_path, err := get_state_file_path()
if err != nil {
c.IndentedJSON(status.GenerateErrorResponse(status.SaveFailed))
return
}
- state_file_path := filepath.Join(dir, "state.json")
-
// write state to file
err = os.WriteFile(state_file_path, state_json, 0644)
if err != nil {