awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
golang avatar

golang/mockArchived

0
View on GitHub↗
9,361 stars·604 forks·Go·Apache-2.0·20 views

Mock

GoMock is a mocking framework for the Go programming language.

Features

  • Go Mocking Libraries - Generates mock implementations from Go interfaces for use in unit tests.
  • Stub and Record Patterns - Allows defining return values for methods while also recording actual call arguments for later assertion.
  • Mock Argument Matchers - Provides a set of matchers that compare actual arguments against expected values or patterns.
  • Mock Implementations - Generates mock implementations by scanning compiled Go packages or source files to discover interface definitions.
  • Interaction Expectations - Matches actual method calls against predefined expectations using argument matchers and call counters.
  • Mock Call Order Verifications - Tracks the sequence of mock method invocations to verify they occur in the expected order.
  • Behavior Verification - Verifies that mocked methods are called with expected arguments and in the correct order during test execution.
  • Mock Behavior Configuration - Configures mock methods to execute custom logic or return fixed values without checking call expectations.
  • Mocking Frameworks - Generates and manages mock implementations of Go interfaces for unit testing with configurable call expectations and stub behavior.
  • Package-Based Generators - Generates mock implementations by scanning compiled Go packages to discover interface definitions.
  • Interface-Based Test Doubles - Tests Go code by replacing real dependencies with mock objects that implement the same interfaces.
  • Source File Generators - Generates mock implementations by reading interface definitions directly from a Go source file.
  • Mock Expectation Verifiers - Verifies that mocked methods receive expected arguments and return configured values during test execution.
  • Test Double Libraries - Provides test doubles for Go interfaces with support for call expectations, argument matching, and return value configuration.
  • Code Generation - Generates mocks for interfaces to support testing.
  • Mocking Tools - Mocking framework for Go.
  • Testing and QA - Mocking framework for Go.
  • Testing and Quality Assurance - Mocking framework for Go.
  • Testing Frameworks - Official mocking framework.

Star history

Star history chart for golang/mockStar history chart for golang/mock

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does golang/mock do?

GoMock is a mocking framework for the Go programming language.

What are the main features of golang/mock?

The main features of golang/mock are: Go Mocking Libraries, Stub and Record Patterns, Mock Argument Matchers, Mock Implementations, Interaction Expectations, Mock Call Order Verifications, Behavior Verification, Mock Behavior Configuration.

What are some open-source alternatives to golang/mock?

Open-source alternatives to golang/mock include: data-dog/go-sqlmock — go-sqlmock is a Go library that simulates SQL driver behavior for unit testing by intercepting database calls through… mockk/mockk — MockK is a Kotlin test double framework that creates mocks, spies, and relaxed mocks for unit testing, with support… devlooped/moq — Moq is a .NET mocking framework and C# library used to create simulated objects and interfaces. Its primary purpose is… h2non/gock — HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽. jarcoal/httpmock — HTTP mocking for Golang. moq/moq4 — Moq4 is a .NET mocking framework used to create simulated implementations of interfaces and abstract classes. It…

Open-source alternatives to Mock

Similar open-source projects, ranked by how many features they share with Mock.
  • data-dog/go-sqlmockDATA-DOG avatar

    DATA-DOG/go-sqlmock

    6,525View on GitHub↗

    go-sqlmock is a Go library that simulates SQL driver behavior for unit testing by intercepting database calls through the standard database/sql/driver interface, eliminating the need for a real database connection. It provides a comprehensive mocking framework that allows developers to define expectations for SQL operations, including queries, executions, prepared statements, and transaction lifecycles, with precise control over the results and errors returned. The library distinguishes itself through its flexible matching and verification capabilities. It supports regex-based or exact SQL

    Godatabasegogolang
    View on GitHub↗6,525
  • mockk/mockkmockk avatar

    mockk/mockk

    5,747View on GitHub↗

    MockK is a Kotlin test double framework that creates mocks, spies, and relaxed mocks for unit testing, with support for final classes, static methods, and coroutines. It functions as a bytecode instrumentation library that modifies compiled class files at load time to intercept constructors, final methods, and static functions without source changes, and also provides dedicated libraries for constructor mocking and coroutine mocking. The framework is designed specifically for Kotlin, handling Kotlin-specific constructs like extension functions, singletons, and suspend functions. MockK disting

    Kotlinargument-matcherschain-callshacktoberfest
    View on GitHub↗5,747
  • devlooped/moqdevlooped avatar

    devlooped/moq

    6,389View on GitHub↗

    Moq is a .NET mocking framework and C# library used to create simulated objects and interfaces. Its primary purpose is to isolate code from external dependencies during unit testing by providing a system for interface simulation and behavioral testing. The framework distinguishes itself through the use of functional specification queries and LINQ-based querying to create declarative mocks. It supports the simulation of complex scenarios, including the automatic generation of recursive mock hierarchies, the implementation of multiple interfaces within a single mock instance, and the ability to

    C#
    View on GitHub↗6,389
  • h2non/gockh2non avatar

    h2non/gock

    2,216View on GitHub↗

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

    Goapiassertionsexpectations
    View on GitHub↗2,216
  • See all 30 alternatives to Mock→