The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning. Learn more →
Top 23 Go Mock Projects
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
hoverfly
Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
-
service-pattern-go
Simple clean Go REST API architecture with dependency injection and mocking example, following SOLID principles.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
go-smtp-mock
SMTP mock server written on Golang. Mimic any 📤 SMTP server behavior for your test environment with fake SMTP server.
-
xgo
Enable function trap in go, provide trace and mock to help write and debug unit test faster (by xhd2015)
-
wiretap
The world's coolest API Validation and compliance tool. Validate APIs against OpenAPI specifications and much more (by pb33f)
-
timex
A test-friendly replacement for golang's time package [managed by soy-programador] (by cabify)
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Project mention: How do you unit-test code that reaches out to the db, without introducing interfaces everywhere? | /r/golang | 2023-08-16
I'm far too lazy to write mocks by hand in go. You can generate a mock for a given interface with mockery https://github.com/vektra/mockery
Since the OpenAPI can effectively describe our resources, we can reuse it to generate a dummy server that can be later used for development and testing purposes without bootstrapping any actual services. There some tools available that can help us with this task, such as Prism, OpenAPI Mock, OpenAPI Backend and the MSW library we have already seen.
If you cannot find something to integrate with your existing test suite, consider using Wiretap which can run as a proxy, and handle contract testing of the requests/responses that come through it in testing or staging environments.
Go Mock related posts
- I Write Tests in Go
- How do you unit-test code that reaches out to the db, without introducing interfaces everywhere?
- Direction of mockery: absorb different styles of mocks into this project · vektra mockery · Discussion #671
- Maintainership of Go’s official gomock repo has been transferred to Uber.
- Uber Now Maintains Gomock
- grpcmock: Mock gRPC servers dynamically
- Google Stopped Maintaining GoMock
-
A note from our sponsor - WorkOS
workos.com | 24 Apr 2024
Index
What are some of the best open-source Mock projects in Go? This list will help you:
Project | Stars | |
---|---|---|
1 | go-sqlmock | 5,827 |
2 | mockery | 5,608 |
3 | hoverfly | 2,307 |
4 | gock | 2,014 |
5 | httpmock | 1,864 |
6 | counterfeiter | 918 |
7 | service-pattern-go | 775 |
8 | Mmock | 660 |
9 | go-txdb | 619 |
10 | gripmock | 610 |
11 | minimock | 556 |
12 | killgrave | 484 |
13 | openapi-mock | 467 |
14 | redismock | 250 |
15 | charlatan | 200 |
16 | govcr | 163 |
17 | go-smtp-mock | 113 |
18 | xgo | 103 |
19 | gomockhandler | 102 |
20 | go-github-mock | 90 |
21 | go-localstack | 75 |
22 | wiretap | 71 |
23 | timex | 70 |
Sponsored