command module
v0.0.0-...-9d55926 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2020 License: MIT Imports: 6 Imported by: 0



Generates mock implementation for gRPC services that allows to use gRPC services in UI Testing and Mock Testing.


Lets take a simple proto file like below,

service EchoService {
    rpc Echo(EchoRequest) returns (EchoResponse);

This will generate a file containing this,

// MockEchoServiceServer is the mock implementation of the EchoServiceServer. Use this to create mock services that
// return random data. Useful in UI Testing.
type MockEchoServiceServer struct{}

// Echo is mock implementation of the method Echo
func (MockEchoServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) {
	var res EchoResponse
	return &res, nil

How to use it?

Just go get it and it will add the plugin to your path,

go get -u

Then use the plugin like below,

protoc -I ./example --mock_out=:./example ./example/example.proto


The Go Gopher

There is no documentation for this package.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL