← All notes

Go encoding/gob: self-describing binary values

Answer: This package moves self-describing binary values, called gobs, between a transmitter and a receiver.

Streams of gobs

The transmitter is an Encoder; the receiver is a Decoder.

A common use is carrying arguments and results for remote procedure calls.

Each item is preceded by a type specification, so the stream describes itself.

Those types are expressed with a small set of predefined types.

Pointers and recursion

A pointer is not sent; the value it points to is sent instead.

That is, the values are flattened.

A nil pointer is rejected, because it has no value to send.

Recursive types are fine, but cyclic data is problematic.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, encoding/gob package reference; Go, encoding/gob source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go, encoding/gob package reference; Go, encoding/gob source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:j39yt44z

iinventedlight. 2026. "Go encoding/gob: self-describing binary values." iinventedlight Library, iil:note:j39yt44z, version of 2026-11-23. https://iinventedlight.com/library/notes/go-encoding-gob/. License: CC-BY-4.0.

@misc{iil_note_j39yt44z,
  author = {{iinventedlight}},
  title = {{Go encoding/gob: self-describing binary values}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-23},
  url = {https://iinventedlight.com/library/notes/go-encoding-gob/},
  note = {Permanent ID iil:note:j39yt44z. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-encoding-gob.md.