GOB: Go's Own Encoding
Go has its own special data encoding protocol called gob
. You can only use gob
when the encoding and decoding are happening in Go. Being limited to Go is only a deal-breaker if you need to communicate with software written in other languages. It's common with software written to be used internally in an organization for both the encoding and decoding software to be written in the same language. As such, it's not a problem in most cases.
If you can use it, gob gives you exceptionally high performance and efficiency. For example, JSON is a string-based protocol that needs to be useable in any programming language. This limits what's possible with JSON and protocols like it. Gob
, on the other hand, is a binary-based protocol, and gob only needs to work for Go users. This frees gob to become a space- and processing-efficient encoding protocol while still being easy to use.
Gob doesn't require any configuration or setup to use. Also...