Check out NATS by example - An evolving collection of runnable, cross-client reference examples for NATS.
Installation
# To get the latest released Go client:
go get github.com/nats-io/nats.go@latest
# To get a specific version:
go get github.com/nats-io/[email protected]
# Note that the latest major version for NATS Server is v2:
go get github.com/nats-io/nats-server/v2@latest