From 04b7efd74a1ec107addff9da055e4e0104d705e0 Mon Sep 17 00:00:00 2001 From: Bennett Wetters Date: Sun, 14 Jan 2024 21:52:23 +0100 Subject: [PATCH] Open the persistent file just for writing when saving --- util/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/util.go b/util/util.go index 282f2e9..086ee2f 100644 --- a/util/util.go +++ b/util/util.go @@ -80,7 +80,7 @@ func SaveCurrentState(response types.SpaceAPIResponseV14) { } // Open persistent state file - file, err := os.OpenFile(savedStateJSONPath, os.O_RDWR|os.O_CREATE, 0644) + file, err := os.OpenFile(savedStateJSONPath, os.O_WRONLY|os.O_CREATE, 0644) if err != nil { log.Fatalln("Failed opening", savedStateJSONPath, "while trying to save current state... error:", err) }