Go Mock

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

Top 23 Go Mock Projects

  • GitHub repo gomock

    GoMock is a mocking framework for the Go programming language. (by golang)

    Project mention: Dependency Injection in Golang | dev.to | 2022-01-20

    If you want to write tests, DI also can help you! Sometimes you need mocks for tests (to be independent of some modules like logger in tests), you have to generate it! There is an amazing tool for this task in go - GoMock. When you describe only needed methods in DI interface, the GoMock generate mocks just for those methods - it is faster and more readable in practice, than hundreds methods in mocks.

  • GitHub repo go-sqlmock

    Sql mock driver for golang to test database interactions

    Project mention: [HELP] how to test this piece of code? | reddit.com/r/golang | 2021-12-29

    There is a good lib for db tests https://github.com/DATA-DOG/go-sqlmock

  • Scout APM

    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.

  • GitHub repo mockery

    A mock code autogenerator for Golang (by vektra)

    Project mention: How do you install commands using go.mod | reddit.com/r/golang | 2021-11-02

    There are some packages in my project that are not used in the source code, but they're used as commands (i.e. https://github.com/vektra/mockery https://github.com/rubenv/sql-migrate).

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

    HTTP mocking for Golang

    Project mention: Best practices around mocking interfaces from external packages | reddit.com/r/golang | 2021-05-06

    Alternatively, you could use an http mock library like https://github.com/jarcoal/httpmock, and override the urls the RealClient calls with a mock response in your tests.

  • GitHub repo counterfeiter

    A tool for generating self-contained, type-safe test doubles in go

    Project mention: Slack notification Github action | reddit.com/r/golang | 2021-08-06
  • 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 Mmock

    Mmock is an HTTP mocking application for testing and fast prototyping

  • GitHub repo minimock

    Powerful mock generation tool for Go programming language

  • GitHub repo go-txdb

    Immutable transaction isolated sql driver for golang

  • GitHub repo killgrave

    Simple way to generate mock servers written in Go

    Project mention: How to integrate an external API into your PHP application🔥 | dev.to | 2021-08-10

    I have used Killgrave and the result was really good. The best of all is that you can configure a mock API just using yml configurations files.

  • GitHub repo openapi-mock

    OpenAPI mock server with random data generation

    Project mention: Eskimo is a supercharged mocking server for developers and testers, that aims to abstract the complexities of coding a mock server into simple JSON configurations. | reddit.com/r/coolgithubprojects | 2022-01-01
  • GitHub repo govcr

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

  • GitHub repo timex

    A test-friendly replacement for golang's time package (by cabify)

  • GitHub repo gomockhandler

    Mr. gomockhandler is the clever and more agile manager of golang/mock 👔

    Project mention: more clever and faster management for gomock (sanposhiho/gomockhandler) | reddit.com/r/golang | 2021-08-19
  • GitHub repo go-localstack

    Go Wrapper for using localstack

  • GitHub repo go-smtp-mock

    SMTP mock server written on Golang. Mimic any 📤 SMTP server behaviour for your test environment with fake SMTP server.

  • GitHub repo mockhttp

    Mock object for Go http.ResponseWriter

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

  • GitHub repo flute

    Golang HTTP client testing framework

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

Go Mock related posts


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

Project Stars
1 gomock 6,679
2 go-sqlmock 4,104
3 mockery 3,201
4 hoverfly 1,821
5 gock 1,551
6 httpmock 1,288
7 counterfeiter 612
8 Mmock 581
9 minimock 436
10 go-txdb 414
11 killgrave 266
12 openapi-mock 252
13 govcr 100
14 timex 57
15 gomockhandler 55
16 go-localstack 30
17 go-smtp-mock 23
18 mockhttp 22
19 go-github-mock 20
20 flute 15
21 mockitout 9
22 mockit 8
23 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.
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.