finds.dev← search

// the find

nats-io/nats.go

★ 6,650 · Go · Apache-2.0 · updated Jun 2026

Golang client for NATS, the cloud native messaging system.

The official Go client for NATS, a lightweight pub/sub and request/reply messaging system. Covers core NATS, JetStream (persistent messaging, KV store, object store), and a service framework (`micro`). If you're building Go microservices and need fast, low-overhead messaging without running Kafka, this is the library.

JetStream API is well-designed — the split between consumer handle and subscription lifecycle is cleaner than most messaging client APIs. The `micro` service layer gives you structured request/reply with health endpoints without much boilerplate. Auth story is solid: NKey/JWT credential support with memory-wiped callbacks means your private key never sits in the client's heap. Test coverage is serious — separate test packages, real server integration, explicit race-condition test files.

Two JetStream APIs exist side-by-side (`js.go` legacy plus the new `jetstream/` package), and the migration guide exists precisely because many users are stuck on the old one — expect to debug which API a Stack Overflow answer is using. The `micro` service API is still marked beta, so its contracts can shift. The `EncodedConn` wrapper (`enc.go`, `netchan.go`) is essentially unmaintained and undocumented relative to the rest; using it for anything beyond toy examples is a gamble. Error handling is inconsistent in places — several Connect paths silently swallow errors when `RetryOnFailedConnect` is set, which makes startup debugging harder than it should be.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →