# uber-go/mock

GoMock is a mocking framework for the Go programming language.

Repository: https://github.com/uber-go/mock
Canonical: https://ross.abutalabs.com/products/uber-go-mock
Language: Go
License: Apache-2.0
License Family: permissive
Last push: 2026-08-25T23:59:55+00:00

## Health v2 (maintenance only)
Score: 73/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 31, longevity 87
- inputs: {"age_days": 1218, "days_push": 8, "days_rel": 380, "gap_med": 55.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3399, forks 176 (observed 2026-08-28T04:08:02.763075+00:00)

## What it is
GoMock (go.uber.org/mock) is a mocking framework for Go that generates mock implementations of interfaces via the mockgen code-generation tool. It is a maintained fork of Google's archived golang/mock, actively maintained by Uber and integrated with Go's built-in testing package.

## Use cases
- generate mocks for Go interfaces
- unit test Go code with mock dependencies
- mock database driver interfaces in Go tests
- replace the abandoned golang/mock project
- set up go:generate-based mock generation
- verify expected method calls in Go tests

## When to choose
- you need a mature, actively maintained mocking framework for Go
- you want generated mocks from interface definitions with source, package, or archive modes
- you're migrating from Google's unmaintained golang/mock
- you want tight integration with Go's standard testing package

## When to avoid
- you prefer hand-written fakes or stubs over generated mocks
- you're not writing Go code
- you need runtime mocking without code generation
- you prefer a lightweight assertion-only library without mock generation

## Facets
- artifact type: library
- maturity: active
- function: mocking, testing, cli
- domain: testing, developer-tools, programming-languages
- platform: go, cli, cross-platform
- tags: gomock, mockgen, unit-testing, test-doubles, interface-mocking, go-testing, code-generation

## Member repositories
- uber-go/mock (main) score 73

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:02.763075+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:38:46.989732+00:00, confidence not recorded.
  - readme: https://github.com/uber-go/mock (fetched 2026-08-28T04:08:02.763075+00:00, sha 5e502679c31a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
