How it works...
Gob encoding is a streaming format built with Go data types in mind. It is most efficient when sending and encoding many consecutive items. For a single item, other encoding formats such as JSON are potentially more efficient and portable. Despite this, gob encoding makes it simple to marshal large complex structs and reconstruct them in a separate process. Although it wasn't shown here, gob can also operate on custom types or unexported types with custom MarshalBinary and UnmarshalBinary methods.
Base64 encoding is useful for communicating via URLs in GET requests or for generating a string representation encoding of binary data. Most languages can support this format and unmarshal the data on the other end. As a result, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access