That's a lot of code to decipher, but it sounds like you're trying to decode a single gob output stream with two different input streams. If I've interpreted you correctly, this is not intended to work. You'd need to either create two output streams (so that type information is encoded into both) or continue using the same input stream.
Clear should really reset the files field entirely, no?
Andrew
-rob
Here is a version of morass and an expanded test suite that has no
dependencies outside the core library except for gocheck.
https://gist.github.com/1957898
It usually passes (this is dependent on which machine it runs on -
failure is more common on my netbook GOARCH=386 than on my workstation
GOARCH=amd64). Failure is usually due to a nil value which somehow
manages to get past the error check after gob decoding, though sometimes
it's an unexpected EOF and sometimes an encoded unsigned integer out of
range.
It feels racy, but it fails independently of whether I'm doing
concurrent writing or not, so I can't explain the sporadic failure. The
test uses rand.Int(), so maybe this is the cause of sporadic failure,
but I would expect gob to be robust to that.
I'm abusing the registration as well, but I can't see how that would
give this outcome.
I've never seen this failure before.
thanks
Dan
On Fri, 2012-03-02 at 18:10 +1100, Rob 'Commander' Pike wrote:
When I'm back at work, I'll check whether this fixes the other problem.
thanks for people's suggestions.
Dan
On Fri, 2012-03-02 at 18:10 +1100, Rob 'Commander' Pike wrote:
thanks
Dan
On Fri, 2012-03-02 at 18:10 +1100, Rob 'Commander' Pike wrote: