The encoder delivers a stream that includes type information. If you
reuse the stream to a different decoder, that decoder will not have
seen the type information sent to the first one.
Or to look at it another way, the encoder just sends the values you
give it, along with any type information that has not already been
transmitted. In effect, it can't tell the difference between calling
it twice to deliver to one encoder and calling it twice to deliver to
two decoders.
Don't reuse the encoder.
-rob
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
golang-nuts...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/589e4ba5-afe4-4cee-9398-326478171492n%40googlegroups.com.