My program has a function that allows the user to update a specific post.
When saving the changes on file database/posts.json I have to replace the content of all the file with the new updated post and rewriting the previously existing ones.
I do so by using the function "UpdatePostList" in internal_functions.go file.
Is there a way to directly modify the lines of the file I really need to change?
I know that there is a function from the os package called "(*os.File).WriteAt", but this uses a byte as starting position.
In order to use it I should know how many bytes I need to read before getting to the line I want to modify.