mock
mock copied to clipboard
GoMock is a mocking framework for the Go programming language.
**Actual behavior** Typing for nested generic interface is scoped to package the interface belongs to and not the pkgs the type belongs to. Here is a complete example: https://github.com/bradleygore/gomock-generics-issue/blob/master/workers/custom.go I...
Consider a source file `notifier.go` we want to mock, with the following pattern : ```go type Clonable[T any] interface { Clone() T } type Finder[T Clonable[T]] interface { Find(ctx context.Context)...
In case I use a concrete type: ``` type Pagination struct { Limit int64 Skip int64 } //go:generate mockgen -source=$GOFILE -destination=mocks/autogen.$GOFILE -package=mocks type IMongoDbClient interface { GetMany(ctx context.Context, collectionName string,...
**Actual behaviour** When I have `EXPECT` set for two calls to the same method with different parameters - the order of `EXPECT` definitions enforces the order of the actual calls....
**Actual behavior** We have a Docker image running mockgen 1.6.0 that we use both as a "CLI tool" locally and inside our CI/CD pipelines. When running the same command both...
As it's not super clear that the fixes listed below are directly related to this issue.
Suppose mockgen was run on a source file that specified `proto.Message`. Today, mockgen will generate a file that imports `"github.com/golang/protobuf/proto"`, which is the current place that `proto.Message` is declared. However,...
Previously `-package` must be explicitly defined or it will default to `mock_${name}`. To generate a mock file that sits next to the package files, eg. as part of the test,...
This is a proposal for `-interfaces` flag using source mode. Using this flag it is possible to list only required interfaces to be mocked in source mode. Currently, source mode...