grpcmock-go
grpcmock-go is a free Go module with utilities for testing gRPC clients and servers.
What grpcmock-go is
grpcmock-go is a free Go module with utilities for testing gRPC clients and servers. It provides mock servers with configurable expectations for methods, headers, and payloads, along with helpers for invoking gRPC methods from tests. Test cases can cover unary, client-streaming, server-streaming, and bidirectional-streaming methods. Request matching supports exact values, regular expressions, JSON, and custom matchers. Mocks can return errors or payloads, or use custom handlers; streaming client calls can also use custom handlers. Services can be registered from generated Go code, as service instances, or by method when generated code is unavailable. The project recommends MockServerWithBufConn for testing an application against a mocked server, and its examples use in-memory bufconn listeners and context dialers. Installation uses `go get go.nhat.io/grpcmock`, and Go 1.25 or later is required. The repository identifies its license as MIT and lists an Open-source Go module plan at no cost.
Good
- Tests unary and three streaming method types
- Supports exact, regex, JSON, and custom request matching
- Registers services without generated Go code
- MIT-licensed open-source Go module
Watch out
- Requires Go 1.25 or later
- The listed platforms are Linux and self-hosted
Who it suits
grpcmock-go suits Go developers who need to test gRPC clients, servers, or streaming methods. It is especially relevant when tests need configurable request matching or in-memory mock-server connections.
Verdict
grpcmock-go provides a broad set of gRPC test utilities for Go, including mock servers, client calls, and multiple streaming styles. Check the Go 1.25-or-later prerequisite before adopting it.
Plans and prices
From grpcmock-go's own pricing page, checked 5 Oct 2026.
| Plan | Price | What it gives you |
|---|---|---|
| Open-source Go module | Free | gRPC testing utilities for Go |
The facts
Each one read from grpcmock-go's own pages, with the date it was checked.
What it does
- Client calls
- It provides helpers to invoke gRPC methods from tests.checked 5 Oct 2026
- Custom handlers
- Streaming client invocations can use custom handlers.checked 5 Oct 2026
- Donation
- The README invites users to buy the maintainer a coffee if the project saved development time.checked 5 Oct 2026
- Funding
- The README invites users who saved development time to buy the maker a cup of coffee.checked 4 Oct 2026
- In-memory connections
- Examples use gRPC bufconn listeners and context dialers for test connections.checked 5 Oct 2026
- In-memory testing
- The server guide recommends MockServerWithBufConn for testing an application with a mocked gRPC server.checked 4 Oct 2026
- Install
- The README gives `go get go.nhat.io/grpcmock` as the installation command.checked 5 Oct 2026
- Installation
- The README gives `go get go.nhat.io/grpcmock` as the installation command.checked 4 Oct 2026
- License
- The repository identifies its license as MIT.checked 5 Oct 2026
- Maintainer
- The repository is published under the GitHub account nhatthm.checked 5 Oct 2026
- Mock responses
- The server guide says mocks can return errors, payloads, or use custom handlers.checked 4 Oct 2026
- Prerequisite
- The README lists Go 1.25 or later as a prerequisite.checked 4 Oct 2026
- Purpose
- grpcmock is a set of gRPC test utilities for Golang.checked 5 Oct 2026
- Release
- GitHub lists v0.34.0, released December 12, 2025, as the latest release.checked 5 Oct 2026
- Request matching
- The server guide documents exact, regular-expression, JSON, and custom matchers for matching values.checked 4 Oct 2026
- Requirement
- The repository README lists Go 1.25 or later as a prerequisite.checked 5 Oct 2026
- Server and client testing
- The README shows utilities for mocking gRPC servers and invoking gRPC methods from tests.checked 4 Oct 2026
- Server mocks
- It lets tests mock a gRPC server and configure expectations for methods, headers, and payloads.checked 5 Oct 2026
- Service registration
- The server guide documents registering generated Go services, service instances, or methods without generated Go code.checked 4 Oct 2026
- Streaming
- It supports unary, client-streaming, server-streaming, and bidirectional-streaming methods.checked 5 Oct 2026
- Supported method types
- The README includes examples for unary, client-streaming, server-streaming, and bidirectional-streaming methods.checked 4 Oct 2026
Alternatives to grpcmock-go
- 1
Kreya
Free planLinuxmacOSWindows7.1Free plan - 2

Bandura
Free planLinuxmacOSSelf-hostedWindows6.7$59 one-time - 3
grpcmd
Free planLinuxmacOSWindows6.7From $9 a year - 4

FintX
Free planLinuxmacOSWindows6.6Free plan - 5
grpcui
Free planWebLinuxmacOSSelf-hosted6.6Free plan - 6
protoc-gen-doc
Free planLinuxmacOSSelf-hostedWindows6.5Free plan
