How do you control behaviour in mocked interface ?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. moq

    Interface mocking tool for go generate (by matryer)

    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.

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. minimock

    Powerful mock generation tool for Go programming language

    In our company projects we use https://github.com/gojuno/minimock for units

  4. counterfeiter

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

    Another alternative to use would be counterfeiter, it generates a type from your interface that could be used as a mock, stub or spy. I wrote a short post covering that tool if you're interested.

  5. mockery

    A mock code autogenerator for Go (by vektra)

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

  6. Testify

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

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

  7. SaaSHub

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

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Is gomock still maintained and recommended?

    7 projects | /r/golang | 6 Mar 2023
  • What mocking framework do you prefer?

    6 projects | /r/golang | 23 Oct 2021
  • I Write Tests in Go

    1 project | news.ycombinator.com | 10 Apr 2024
  • Direction of mockery: absorb different styles of mocks into this project · vektra mockery · Discussion #671

    1 project | /r/golang | 11 Jul 2023
  • Go: Write Mock Test cases using Mockery and

    1 project | dev.to | 10 May 2023

Did you know that Go is
the 4th most popular programming language
based on number of references?