# matryer/moq

Interface mocking tool for go generate

Repository: https://github.com/matryer/moq
Canonical: https://ross.abutalabs.com/products/matryer-moq
Homepage: http://bit.ly/meetmoq
Language: Go
License: MIT
License Family: permissive
Topics: golang, mocking, testing, codegen
Last push: 2026-03-20T06:24:39+00:00

## Health v2 (maintenance only)
Score: 75/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 73, release rhythm 63, longevity 100
- inputs: {"age_days": 3656, "days_push": 166, "days_rel": 166, "gap_med": 81, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2208, forks 135 (observed 2026-08-28T04:06:26.154260+00:00)

## What it is
Moq is a Go code generation tool that creates mock structs from any Go interface for use in unit tests. It integrates with go generate and produces structs with function fields for each interface method, enabling per-test mock behavior.

## Use cases
- generate mocks for go interfaces
- reduce boilerplate when writing go unit tests
- mock dependencies in go tests via go generate
- verify interface method calls in tests
- create test doubles for interfaces

## When to choose
- you write Go unit tests with interface-based dependencies
- you want mocks generated automatically via go generate
- you prefer lightweight function-field mocks over reflection-based mocking frameworks

## When to avoid
- you need a full mocking framework with expectation DSLs
- your project is not written in Go
- you prefer hand-written fakes or stubs

## Facets
- artifact type: cli-tool
- maturity: active
- function: mocking, testing, cli, developer-tools
- domain: testing, developer-tools
- platform: go, cli, cross-platform
- tags: go-generate, codegen, unit-testing, interface-mocks, command-line

## Member repositories
- matryer/moq (main) score 75

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:26.154260+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-30T02:46:20.942417+00:00, confidence not recorded.
  - readme: https://github.com/matryer/moq (fetched 2026-08-28T04:06:26.154260+00:00, sha 1cb658a2ae18)
  - homepage: http://bit.ly/meetmoq (fetched 2026-08-29T10:26:39.269286+00:00, sha 89a24741f521)
- Data as of 2026-08-30T08:39:29.467469+00:00.
