Awesome Go

Mock

19 libraries in Testing / Mock

go-sqlmock

Mock SQL driver for testing database interactions

TestingMock
govcr

HTTP mock for Golang: record and replay HTTP interactions for offline testing

TestingMock
hoverfly

HTTP(S) proxy for recording and simulating REST/SOAP APIs with extensible middleware and easy-to-use CLI

TestingMock
httpmock

Easy mocking of HTTP responses from external resources

TestingMock
minimock

Mock generator for Go interfaces

TestingMock
mockery

Tool to generate Go interfaces

TestingMock
connexions

Combine multiple APIs with meaningful responses, configurable latency and error codes based on OpenAPI 3.0 specifications and files

TestingMock
counterfeiter

Tool for generating self-contained mock objects

TestingMock
go-localstack

Tool for using localstack in AWS testing

TestingMock
go-txdb

Single transaction based database driver mainly for testing purposes

TestingMock
gock

Versatile HTTP mocking made easy

TestingMock
gomock

Mocking framework for the Go programming language

TestingMock
mockfs

Mock filesystem for Go testing with error injection and latency simulation, built on `testing/fstest.MapFS`

TestingMock
mockhttp

Mock object for Go http.ResponseWriter

TestingMock
mooncake

A simple way to generate mocks for multiple purposes

TestingMock
moq

Utility that generates a struct from any interface. The struct can be used in test code as a mock of the interface

TestingMock
pgxmock

A mock library implementing [pgx - PostgreSQL Driver and Toolkit](https://github.com/jackc/pgx/)

TestingMock
timex

A test-friendly replacement for the native `time` package

TestingMock
xgo

A general pureposed function mocking library

TestingMock