Go Mocking

Open-source Go projects categorized as Mocking

Top 16 Go Mocking Projects

  • Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

    Project mention: Is gomock still maintained and recommended? | reddit.com/r/golang | 2023-03-06

    To answer OP directly, I am largely quite happy with mockery (and testify) to write expressive tests.

  • mockery

    A mock code autogenerator for Golang (by vektra)

    Project mention: Is gomock still maintained and recommended? | reddit.com/r/golang | 2023-03-06

    When there's just one heavyweight dependency you're interacting with, perhaps a one-off stub/fake is simpler, but I would posit that auto-generated mocks via things like mockery + go:generate leave less test code to maintain vs. perhaps many stubs across the project.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • hoverfly

    Lightweight service virtualization/ API simulation / API mocking tool for developers and testers

    Project mention: We created WireMock, an API platform that is designed to improve developer productivity and enables developers and testers to Mock APIs in every stage of the API lifecycle | reddit.com/r/golang | 2023-02-02

    Use https://github.com/SpectoLabs/hoverfly

  • gock

    HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽

    Project mention: Testing calls to external APIs | reddit.com/r/golang | 2022-12-09

    Mocking the http client with explicit responses; for example using h2non/gock

  • moq

    Interface mocking tool for go generate

    Project mention: Is gomock still maintained and recommended? | reddit.com/r/golang | 2023-03-06

    ``` https://github.com/matryer/moq

  • apitest

    A simple and extensible behavioural testing library for Go. You can use api test to simplify REST API, HTTP handler and e2e tests.

    Project mention: Writing unit tests for an a library that needs to perform internet related tasks? | reddit.com/r/golang | 2023-03-21

    take a look at something like: github.com/steinfletcher/apitest mock the behaviour, record calls and assert.

  • vfs for golang

    Virtual filesystem library written in golang

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

  • dummy

    Run mock server based off an API contract with one command (by neotoolkit)

  • go-github-mock

    A library to aid unittesting code that uses Golang's Github SDK

  • go-sdk

    Official Keploy Go SDK 🔵 (by keploy)

    Project mention: Mocking database queries - ask for opinion | reddit.com/r/golang | 2022-07-09

    The same idea was used to generate and mock sql queries in keploy - https://github.com/keploy/go-sdk/tree/main/integrations/ksql

  • mockc

    Completely type-safe compile-time mock generator for Go

  • mocha

    Build Mock APIs in Go (by vitorsalgado)

    Project mention: Mocha: Open-Source Mock API Builder for Go | news.ycombinator.com | 2022-08-09
  • mockcompose

    mockcompose generates mocking implementation for Go classes, interfaces and functions

  • mockit

    Library that make mocking of Go functions/methods easy (by pasdam)

  • mockitout

    A language agnostic HTTP mock server for quick stub testing

  • gokka

    A small Go mocking library powered by Cue

    Project mention: Gokka - A small mocking library powered by CUE | reddit.com/r/golang | 2022-08-14
  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-03-21.

Go Mocking related posts


What are some of the best open-source Mocking projects in Go? This list will help you:

Project Stars
1 Testify 19,223
2 mockery 4,470
3 hoverfly 2,039
4 gock 1,816
5 moq 1,523
6 apitest 614
7 vfs for golang 442
8 dummy 170
9 go-github-mock 62
10 go-sdk 33
11 mockc 30
12 mocha 27
13 mockcompose 14
14 mockit 14
15 mockitout 10
16 gokka 3
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives