Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/gob: Decoder cannot be reused if a composite types are involved #29766
What version of Go are you using (
This is working as intended. The output from the Encoder is a stream, and is meant to be read, once, as a stream. You're using it wrong.
Mechanically, if the stream contains type information, as it will if there is a non-base type, then as the Decoder runs it will change state to absorb that type. That means the second time you run it with the same data, it will be inconsistent and break.