Open the persistent file just for writing when saving
This commit is contained in:
parent
70b2e8069b
commit
04b7efd74a
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue