This is a protoc plugin that generates type-safe mock implementations for gRPC services using the testify mock library.
go install github.com/tim-oster/protoc-gen-go-grpc-mock@latest
protoc --go-grpc-mock_out=./ file.proto
Doc: https://grpc.io/docs/protoc-installation/
PB_VER="23.4"
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v${PB_VER}/protoc-${PB_VER}-linux-x86_64.zip
unzip -o protoc-${PB_VER}-linux-x86_64.zip -d $HOME/.local
rm protoc-${PB_VER}-linux-x86_64.zip
Doc: https://grpc.io/docs/languages/go/quickstart/
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]