grpcmock-go
github.com
What it is
grpcmock-go is a free, MIT-licensed Go module providing gRPC testing utilities. It helps tests mock gRPC servers, configure expectations for methods, headers, and payloads, and invoke client calls. Supported methods include unary, client-streaming, server-streaming, and bidirectional-streaming patterns. Request matching can use exact values, regular expressions, JSON, or custom matchers. Mock responses may return payloads, errors, or custom-handler results, and streaming client invocations can use custom handlers. Services can be registered from generated Go code, service instances, or individual methods when generated code is unavailable. The project recommends MockServerWithBufConn for in-memory application testing, with examples using bufconn listeners and context dialers. Installation uses `go get go.nhat.io/grpcmock`, and Go 1.25 or later is required. GitHub lists v0.34.0, released December 12, 2025, as the latest release. The Open-source Go module plan costs nothing.
Spec sheet
- Purpose
- grpcmock is a set of gRPC test utilities for Golang.Read 5 Oct 2026 · github.com
- License
- The repository identifies its license as MIT.Read 5 Oct 2026 · github.com
- Client calls
- It provides helpers to invoke gRPC methods from tests.Read 5 Oct 2026 · github.com
- Custom handlers
- Streaming client invocations can use custom handlers.Read 5 Oct 2026 · github.com
- Donation
- The README invites users to buy the maintainer a coffee if the project saved development time.Read 5 Oct 2026 · github.com
- Funding
- The README invites users who saved development time to buy the maker a cup of coffee.Read 4 Oct 2026 · github.com
- In-memory connections
- Examples use gRPC bufconn listeners and context dialers for test connections.Read 5 Oct 2026 · github.com
- In-memory testing
- The server guide recommends MockServerWithBufConn for testing an application with a mocked gRPC server.Read 4 Oct 2026 · github.com
- Install
- The README gives `go get go.nhat.io/grpcmock` as the installation command.Read 5 Oct 2026 · github.com
- Installation
- The README gives `go get go.nhat.io/grpcmock` as the installation command.Read 4 Oct 2026 · github.com
- Maintainer
- The repository is published under the GitHub account nhatthm.Read 5 Oct 2026 · github.com
- Mock responses
- The server guide says mocks can return errors, payloads, or use custom handlers.Read 4 Oct 2026 · github.com
- Prerequisite
- The README lists Go 1.25 or later as a prerequisite.Read 4 Oct 2026 · github.com
- Release
- GitHub lists v0.34.0, released December 12, 2025, as the latest release.Read 5 Oct 2026 · github.com
- Request matching
- The server guide documents exact, regular-expression, JSON, and custom matchers for matching values.Read 4 Oct 2026 · github.com
- Requirement
- The repository README lists Go 1.25 or later as a prerequisite.Read 5 Oct 2026 · github.com
- Server and client testing
- The README shows utilities for mocking gRPC servers and invoking gRPC methods from tests.Read 4 Oct 2026 · github.com
- Server mocks
- It lets tests mock a gRPC server and configure expectations for methods, headers, and payloads.Read 5 Oct 2026 · github.com
- Service registration
- The server guide documents registering generated Go services, service instances, or methods without generated Go code.Read 4 Oct 2026 · github.com
- Streaming
- It supports unary, client-streaming, server-streaming, and bidirectional-streaming methods.Read 5 Oct 2026 · github.com
- Supported method types
- The README includes examples for unary, client-streaming, server-streaming, and bidirectional-streaming methods.Read 4 Oct 2026 · github.com
Plans and prices
Strong points and limits
Strong points
- Mocks gRPC servers and client calls
- Supports all four listed streaming patterns
- Multiple request-matching strategies
- Custom handlers for responses
- MIT license
Limits
- Requires Go 1.25 or later
- Linux and self-hosted platforms listed
- No graphical editor is described
- Latest listed release is v0.34.0
Who it suits
grpcmock-go suits Go developers writing tests for gRPC clients, servers, streaming methods, and in-memory connections. It is available for Linux and self-hosted use.
Verdict
grpcmock-go focuses on programmable gRPC test doubles and client invocation helpers for Go projects. It is free under the listed Open-source Go module plan, with installation provided through Go’s module tooling.
Where Specifiction places it
- gRPC Tools#6 of 248.1