File written to by the program not saving occasionally
Baconman321 (1104)

I have a program in Go that allows me to make and edit articles.

Sometimes, though the program won't save an edit of the article. The articles are stored via a .json file.

I have noticed that this usually happens if I close out of the window after it says it has successfully been edited, OR I close out of the computer. It always saves if I open the repl and check if it has been saved (as far as I know).

@tussiez told me that it was simply replit not saving sometimes, but I start to doubt that. It shows the edited article, but if I come back the next day the new edit is gone! It must be deleting the contents of the edit, but why? Also, how would I fix this?

Help would be appreciated.

- A confused bacon

You are viewing a single comment. View All
InvisibleOne (3224)

Is this a text file on replit? Becuase occasionally replit will not save what your code has written to a text file if you are say; opening it in another tab or something. This is because replit does not save changes unless they are made by you, if that makes any sense.

Baconman321 (1104)


The articles are stored via a .json file.

I already found the answer, but now I need to know how to work around this.