Is there a way to append marshalled json object into json array inside a file, without loading that file?
Here is what I mean:
Contents of "file.json":
// json array
[
// json objects
{...},
{...},
{...}
// APPEND NEW marshalled json object here
]
If that's not possible or not efficient, then how viable is holding 20MB worth of structs in a slice for a long period of time?
You'll have to operate on the raw byte stream, you can remove the closing tags, append the new json objects in and rewrite the closing tags again.