# golang/mock

GoMock is a mocking framework for the Go programming language.

Repository: https://github.com/golang/mock
Canonical: https://ross.abutalabs.com/products/golang-mock
Language: Go
License: Apache-2.0
License Family: permissive
Archived: true
Last push: 2024-01-08T08:00:38+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4100, "days_push": 968, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 9341, forks 604 (observed 2026-08-28T04:10:30.667644+00:00)

## What it is
GoMock is a mocking framework for Go that generates mock implementations of interfaces via the mockgen code-generation tool. It integrates with Go's built-in testing package, but the repository is no longer maintained in favor of the go.uber.org/mock fork.

## Use cases
- generate mocks for Go interfaces
- unit test Go code with mocked dependencies
- mock database or API interfaces in Go tests
- set up expectation-based testing in Go
- replace real dependencies with test doubles in Go

## When to choose
- you are working on a legacy Go codebase already using gomock
- you need the original gomock API for compatibility with existing generated mocks

## When to avoid
- you are starting a new Go project - use the maintained go.uber.org/mock fork instead
- you need ongoing bug fixes or support for newer Go versions
- you prefer hand-written fakes or a different mocking style

## Facets
- artifact type: library
- maturity: abandoned
- function: testing, mocking, cli
- domain: testing, developer-tools, backend
- platform: go, cli, cross-platform
- tags: gomock, mock-generation, code-generation, unit-testing, unmaintained

## Member repositories
- golang/mock (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:30.667644+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-29T17:22:27.892159+00:00, confidence not recorded.
  - readme: https://github.com/golang/mock (fetched 2026-08-28T04:10:30.667644+00:00, sha c03d489b578e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
