← All notes

Go net/rpc: call exported methods across a network connection

Answer: Package rpc provides access to the exported methods of an object across a network.

A frozen service model

This package is frozen: it takes no new features.

Registering an object publishes a service whose name is the object's type.

Once registered, the object's exported methods can be reached remotely.

Two objects of the same type cannot both be registered.

Methods, codecs, and clients

Only methods that satisfy these criteria will be made available for remote access.

A non-nil error return means the reply is not sent back to the client.

Unless a codec is set up explicitly, encoding/gob is used to transport the data.

The convenience functions Dial and DialHTTP perform both steps for a connection.

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: The Go Authors, net/rpc; The Go Authors, net/rpc 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: The Go Authors, net/rpc; The Go Authors, net/rpc source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:98qppeh2

iinventedlight. 2026. "Go net/rpc: call exported methods across a network connection." iinventedlight Library, iil:note:98qppeh2, version of 2026-11-26. https://iinventedlight.com/library/notes/go-net-rpc/. License: CC-BY-4.0.

@misc{iil_note_98qppeh2,
  author = {{iinventedlight}},
  title = {{Go net/rpc: call exported methods across a network connection}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-26},
  url = {https://iinventedlight.com/library/notes/go-net-rpc/},
  note = {Permanent ID iil:note:98qppeh2. 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-net-rpc.md.