Skip to content

Guide · Open source

How to use Go kit: install, build microservices and tips

Updated · written with AI from the project's own documentation and checked against our catalogue data

Go kit is an MIT-licensed set of Go packages and practices for building microservices or modular monoliths. This guide explains what the project is, how to get the source from its repository, and which problems it is designed to solve. After reading, you will know whether Go kit fits your Go backend and where to start.

Go kitgo-kit/kit · ★ 27.4k · MIT

Quick start

  1. 1Check your Go install. Confirm Go is installed on your machine. The README does not state a minimum version, so use a recent one that your project supports.
  2. 2Clone the repository. Run git clone https://github.com/go-kit/kit to get the source locally.
  3. 3Read the goals and non-goals. Confirm your architecture uses RPC and does not need pub/sub or CQRS, since the README lists those as non-goals.
  4. 4Choose your transport and serialization. Pick the transport and serialization your services need, since Go kit is built to be pluggable rather than JSON over HTTP only.
  5. 5Consider a code generator. If you want generated code, review the third-party generators the README lists and check whether each is maintained.
  6. 6Ask the community. Use the mailing list or the #go-kit Slack channel for questions about your design.

What is Go kit and who is it for?

Go kit is a programming toolkit that addresses common problems in distributed systems and application architecture, so developers can focus on business logic. According to its README, it is aimed at RPC-style communication in mixed service environments, with pluggable serialization and transport.

It suits Go developers building service-oriented or microservice backends, and teams whose services talk to non-Go-kit services. It is written for Go, so it is not a fit for developers who work in other languages.

  • Good fit: Go backends split into services, or modular monoliths written in Go.
  • Good fit: teams that want transports and serialization beyond JSON over HTTP.
  • Poor fit: non-Go developers, or projects that need pub/sub or CQRS messaging.

Install Go kit by cloning the repository

The README's install method is to clone the repository from GitHub. Go kit is module-aware and the README encourages standard modules tooling, so you will normally use Go's package management when adding it to your own project.

The README does not state a required Go version, so check the project's own files before you start. The clone command is shown below.

  • Prerequisite: Go is required. The README does not specify which version.
  • Go kit is at major version 0 and the README says it should work in non-modules environments too.
git clone https://github.com/go-kit/kit

Understand Go kit's goals and non-goals

Go kit's stated goals are to operate in a heterogeneous service-oriented architecture where most services are not Go kit services, to use RPC as the primary messaging pattern, and to offer pluggable serialization and transport rather than only JSON over HTTP. It also aims to work within existing infrastructure without mandating specific tools.

The README lists non-goals too. It does not support messaging patterns other than RPC for now, such as MPI, pub/sub or CQRS. It does not re-implement functionality that existing software can provide. It also has no opinions on deployment, configuration, process supervision or orchestration.

  • Goal: RPC as the primary messaging pattern.
  • Goal: pluggable serialization and transport.
  • Non-goal: pub/sub, CQRS and other messaging patterns for now.
  • Non-goal: deployment, configuration and orchestration opinions.

The README lists several third-party code generators that can produce Go kit code from different starting assumptions. Examples include microgen, marvin, mga, protoc-gen-go-kit and truss. The README marks kujtimiihoxha/kit as unmaintained.

If you are comparing options, the README also lists related projects such as gizmo, go-micro, grpc-go and Kite. It notes that gizmo and go-micro have had particular influence on Go kit's design.

  • Generators: RecoLabs/microgen, nytimes/marvin, sagikazarmark/mga, sagikazarmark/protoc-gen-go-kit, metaverse/truss.
  • Service frameworks: gizmo, go-micro, Kite.
  • HTTP/2 RPC library listed: grpc/grpc-go.

Find documentation, community and help

The README points to the website at gokit.io for further details, and to a Go kit mailing list. Questions can also be asked in the #go-kit channel on the Gophers Slack. The README links to the motivating blog post and talks for background on the design.

For contributions, the README directs readers to CONTRIBUTING.md in the repository.

  • Website: gokit.io
  • Mailing list: go-kit on Google Groups
  • Slack: #go-kit on gophers.slack.com
  • Contributions: see CONTRIBUTING.md

What people use it for

  • Building a set of Go microservices that exchange RPC calls.
  • Connecting Go services to non-Go-kit services in a mixed environment.
  • Structuring a modular monolith written in Go.
  • Using pluggable transports and serialization instead of JSON over HTTP alone.

Frequently asked questions

Is Go kit free to use?

Yes. Go kit is licensed under the MIT licence, as stated on its project page. Check the LICENSE file in the repository for the full text.

What do I need to install Go kit?

You need Go installed. The README does not say which Go version is required, so check the project's files or ask the maintainers. The README's install step is to clone the repository from GitHub.

Can I use Go kit with languages other than Go?

Go kit is a toolkit written for Go. The README's goals include interacting with non-Go-kit services, so other services can be part of the system, but you write your Go kit code in Go.

Does Go kit support pub/sub or CQRS?

Not for now. The README lists messaging patterns other than RPC, such as pub/sub and CQRS, as non-goals.

Does Go kit handle deployment or orchestration?

No. The README says Go kit has no opinions on operational concerns such as deployment, configuration, process supervision and orchestration.

What are alternatives to Go kit?

The README and project listings mention gizmo, go-micro, grpc-go and gRPC-based frameworks such as Kratos. Compare them against your needs for RPC, transports and serialization.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Go kit suits Go developers who are building microservices or modular monoliths and want pluggable RPC transports and serialization. Teams that need pub/sub or CQRS, want opinions on deployment, or work outside Go should look at other tools.

Install options & downloads