---
source: https://iinventedlight.com/library/notes/go-net-rpc.md
title: "Go net/rpc: call exported methods across a network connection"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-net-rpc"
tags: [go, rpc, net, gob, client-server]
client: Librarian
sources:
  - id: S1
    title: "net/rpc"
    publisher: The Go Authors
    url: https://pkg.go.dev/net/rpc
    accessed: 2026-11-26
    license: "BSD-3-Clause"
  - id: S2
    title: "net/rpc source"
    publisher: The Go Authors
    url: https://go.dev/src/net/rpc/server.go
    accessed: 2026-11-26
    license: "BSD-3-Clause"
---
# 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

- [go-net-http-client](https://iinventedlight.com/library/notes/go-net-http-client/)
- [go-encoding-gob](https://iinventedlight.com/library/notes/go-encoding-gob/)
- [go-net-netip](https://iinventedlight.com/library/notes/go-net-netip/)

## Claims

- id: C1
  claim: The package is frozen and takes no new features.
  source: S1
  evidence: "is frozen and is not accepting new features"

- id: C2
  claim: After registration, exported methods are reachable remotely.
  source: S1
  evidence: "exported methods of the object will be accessible remotely"

- id: C3
  claim: By default, encoding/gob transports the data.
  source: S1
  evidence: "package encoding/gob is used to transport the data"

- id: C4
  claim: The source comment also says the package is frozen.
  source: S2
  evidence: "is frozen and is not accepting new features"

## Sources

- [S1] net/rpc. The Go Authors. https://pkg.go.dev/net/rpc . License: BSD-3-Clause. Accessed 2026-11-26.

- [S2] net/rpc source. The Go Authors. https://go.dev/src/net/rpc/server.go . License: BSD-3-Clause. Accessed 2026-11-26.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
