Go Mocking

Open-source Go projects categorized as Mocking | Edit details
Related topics: #Golang #Testing #Mock #Go #Testify

Top 10 Go Mocking Projects

  • GitHub repo Testify

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

    Project mention: How do you control behaviour in mocked interface ? | reddit.com/r/golang | 2022-01-21

    I’m a fan of https://github.com/stretchr/testify

  • GitHub repo mockery

    A mock code autogenerator for Golang (by vektra)

    Project mention: How do you control behaviour in mocked interface ? | reddit.com/r/golang | 2022-01-21

    I use mockery to generate mocks based on my interfaces: https://github.com/vektra/mockery

  • 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.

  • GitHub repo hoverfly

    Lightweight service virtualization/API simulation tool for developers and testers

  • GitHub repo gock

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

    Project mention: Testing methods with HTTP calls? | reddit.com/r/golang | 2021-11-19

    h2non/gock and

  • GitHub repo moq

    Interface mocking tool for go generate

    Project mention: How do you control behaviour in mocked interface ? | reddit.com/r/golang | 2022-01-21

    I like the way of matryer/moq a lot. Basically, it generates a func for each of the methods of an interface, therefore the behaviour is clear to everyone without too much abstraction.

  • GitHub repo vfs for golang

    Virtual filesystem library written in golang

  • GitHub repo go-github-mock

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

    Project mention: Building GitHub Apps with Golang | dev.to | 2022-01-17

    So far we've been testing the app with localtunnel, which is nice for quick ad-hoc tests against live API, but it doesn't replace proper unit tests. To write unit tests for this app, we need to mock-out the API to avoid being dependent on the external service. To do so, we can use go-github-mock:

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • GitHub repo mockitout

    A language agnostic HTTP mock server for quick stub testing

  • GitHub repo mockit

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

    Project mention: Unit Testing in Golang | reddit.com/r/golang | 2021-02-01

    A different approach to mocking in Go https://github.com/pasdam/mockit that is more similar to JavaScript and Mockito (Java).

  • GitHub repo mockcompose

    mockcompose generates mocking implementation for Go classes, interfaces and functions

    Project mention: mockcompose to generate mocking implementation for Go classes, interfaces and functions | reddit.com/r/golang | 2021-07-06

    Part of reason that I went ahead to build mockcompose was for to improve test coverage of an existing project without major refactoring. Another reason is for completeness of a mocking tool to cover all possible aspects in unit-test scenarios that Go technically allows. It was meant to use it with Go best practices in mind.

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 2022-01-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 15,220
2 mockery 3,201
3 hoverfly 1,821
4 gock 1,551
5 moq 1,177
6 vfs for golang 406
7 go-github-mock 20
8 mockitout 9
9 mockit 8
10 mockcompose 7
Find remote jobs at our new job board 99remotejobs.com. There are 29 new remote jobs listed recently.
Are you hiring? Post a new remote job listing for free.
Less time debugging, more time building
Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.