GitPedia

Mockery

A mock code autogenerator for Go

From vektra·Updated June 20, 2026·View on GitHub·

mockery provides the ability to easily generate mocks for Golang interfaces using the [stretchr/testify/mock](https://pkg.go.dev/github.com/stretchr/testify/mock?tab=doc) package. It removes the boilerplate coding required to use mocks. The project is written primarily in Go, distributed under the BSD 3-Clause "New" or "Revised" License license, first published in 2014. It has gained significant community traction with 7,140 stars and 455 forks on GitHub. Key topics include: generation, generator, go, golang, mock.

Latest release: v3.7.1
June 12, 2026View Changelog →

mockery

go.dev reference GitHub go.mod Go version GitHub release (latest SemVer) Go Report Card codecov

mockery provides the ability to easily generate mocks for Golang interfaces using the stretchr/testify/mock package. It removes the boilerplate coding required to use mocks.

Documentation

Documentation is found at our GitHub Pages site.

Development

taskfile.dev is used for build tasks. Initialize all go build tools:

go mod download -x

You can run any of the steps listed in Taskfile.yml:

$ task test
task: [test] go test -v -coverprofile=coverage.txt ./...

Stargazers

Stargazers over time

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from vektra/mockery via the GitHub API.Last fetched: 6/21/2026