Ok, I think I understand:
When gob writing to a file,
to intermittently append new objects
without re-writing the type header data
on each append
I need to use the same encoder instance.
That means I need to keep the file handle open
(since creating the encoder
requires the stream).
My other choice is to not append
and simply rewrite the entire file.
(I re-read the docs carefully,
but did not see the text you refer to.)
I wonder why the decoder thinks it's an error
if the same type declaration appears twice.
The library could assume
that I know what I'm doing,
and let the first (or last) type definition win,
and panic if that is not the case.
(Maybe that panic part is hard?)
Thanks,
Mark