Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gob Decoder Returning EOF Error

Tags:

go

gob

I am attempting to implement an interface based message queue where jobs are pushed as bytes to a redis queue. But I keep receiving an EOF error when attempting to decode the byte stream.

https://play.golang.org/p/l9TBvcn9qg

Could someone point me in the right direction?

Thank you!

like image 563
alienchow Avatar asked Aug 03 '26 04:08

alienchow


1 Answers

Found the answer to the problem from Mark above. I have forgotten to do a gob.Register(B{})

https://play.golang.org/p/7rQDHvMhD7

like image 90
alienchow Avatar answered Aug 05 '26 20:08

alienchow



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!