Golang is an interesting programming language. Apart from all the hype it gets due to Google backing it up, I personally feel comfortable using it instead of Scala. Srry I digress, Its just that Scala is annoying me a lot lately... (more on that later).
So, Go-nuts guys came up with Gob (not to be confused with GObjects of GNOME) way to store data. I usually use JSON for marshaling and un-marshaling my content and have my data in JSON format. But Golang is a real pain if you need to work on json data, especially to the people who come from utopia of Python. So I decided to use Go encoded objects instead. The following snippet will encode any type of object.
So, Go-nuts guys came up with Gob (not to be confused with GObjects of GNOME) way to store data. I usually use JSON for marshaling and un-marshaling my content and have my data in JSON format. But Golang is a real pain if you need to work on json data, especially to the people who come from utopia of Python. So I decided to use Go encoded objects instead. The following snippet will encode any type of object.
The following snippet will decode anytype of object. Thats all. All I need to know is what type of object is I am encoding or decoding , else you will get runtime errors on decoding it.
Its as simple as that!