Comments (1)
Adding this comment to clarify the issue after taking a look:
Today, Do() and DoReturn() expect the function provided to it to match the signature of the underlying Call object method. If the underlying Call method being mocked does not have parameters, Do and DoAndReturn work as expected.
The user ask is to drop the restriction in the case of anonymous functions with no parameter when the underlying Call method has parameters for the convenience of not needing to specify parameters when calling Do() or DoAndReturn().
from mock.
Related Issues (20)
- Indicate that the project is subject to the Uber contributor license agreement HOT 1
- Split the Package comment from the "boilerplate" comments HOT 1
- Add a matcher for checking a string parameter against regex
- deadlock on unexpected call with mocked argument implementing `fmt.Stringer`
- mock_names flag does not change naming of ...Call struct in typed mocks
- Code generated by mockgen on Windows should not be different HOT 1
- Broken unit tests on Windows HOT 1
- Export the mockgen API as a library for use by other projects in generating mock codes.
- Support generating mock for interfaces with generics HOT 10
- Release schedule HOT 2
- Improve default failed equality match output to more clearly show diffs HOT 1
- Add a helper method for inline setup of mocks HOT 1
- Flag `-write_generate_directive` produces wrong paths in the directive
- Generating mocks on a file with a dot import creates a compilation error
- Support specifying interfaces to mock when using source mode
- Error when mock generating dot import file with different package name
- Able to insert copyright file which already has comments into the header HOT 2
- The use of `reflect.DeepEqual()` inside `Eq()` matcher is not trivial but not documented.
- Allow control over matching order of call expectations HOT 3
- Aliased imports don't propagate well in the generated mocks (at least in source mode) HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mock.