Follow-up comments from Ash:
Instead of Stat and ReadAT,
you can use Seek:
f.Seek(TrailerSize, 2)
(or maybe -TrailerSize )
Seek sets the offset for the next Read or Write on file to offset, interpreted according to whence: 0 means relative to the origin of the file, 1 means relative to the current offset, and 2 means relative to the end. It returns the new offset and an error, if any.
The behavior of Seek on a file opened with O_APPEND is not specified.pkg.go.devos package - os - Go Packages Package os provides a platform-independent interface to operating system functionality.
A possible concern with appending trailing data is falling foul of virus checkers. Not sure how likely that is, but I know on Windows that sort of "trailing data" is a quite frequent sign of virus/malware etc.
I Just something to bear in mind
Follow-up comments from Ash: