Open the persistent file just for writing when saving

This commit is contained in:
Bendodroid 2024-01-14 21:52:23 +01:00
parent 70b2e8069b
commit 04b7efd74a
Signed by: bendodroid
GPG key ID: 3EEE19A0F73D5FFC

View file

@ -80,7 +80,7 @@ func SaveCurrentState(response types.SpaceAPIResponseV14) {
} }
// Open persistent state file // 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 { if err != nil {
log.Fatalln("Failed opening", savedStateJSONPath, "while trying to save current state... error:", err) log.Fatalln("Failed opening", savedStateJSONPath, "while trying to save current state... error:", err)
} }