This issue is a feature proposal based on matryer/moq#226 (implemented in matryer/moq#227).
Some interfaces may have a mechanism to guarantee that a specific type is embedded.
For example, the <ServiceName>Server interface generated by protoc-gen-go-grpc contains an unexported mustEmbedUnimplemented<ServiceName>Server method, which can be implemented by embedding the Unimplemented<ServiceName>Server from the same package.
You can find more information here:
https://github.com/grpc/grpc-go/tree/master/cmd/protoc-gen-go-grpc#future-proofing-services
Real examples can be seen in the helloworld example of grpc-go:
To support this pattern, I propose a feature that allows specified types to be embedded in mocks.
The .mockery.yml would likely look like this:
packages:
google.golang.org/grpc/examples/helloworld/helloworld:
interfaces:
GreeterServer:
config:
embed-types:
- UnimplementedGreeterServer
Since the purpose is to embed types that implement unexported methods, the types used must belong to the same package as the interface.
This issue is a feature proposal based on matryer/moq#226 (implemented in matryer/moq#227).
Some interfaces may have a mechanism to guarantee that a specific type is embedded.
For example, the
<ServiceName>Serverinterface generated byprotoc-gen-go-grpccontains an unexportedmustEmbedUnimplemented<ServiceName>Servermethod, which can be implemented by embedding theUnimplemented<ServiceName>Serverfrom the same package.You can find more information here:
https://github.com/grpc/grpc-go/tree/master/cmd/protoc-gen-go-grpc#future-proofing-services
Real examples can be seen in the helloworld example of grpc-go:
To support this pattern, I propose a feature that allows specified types to be embedded in mocks.
The
.mockery.ymlwould likely look like this:Since the purpose is to embed types that implement unexported methods, the types used must belong to the same package as the interface.