-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mockgen): respect custom function implementations
Prior to this change, a user of mockgen was free to include any function declarations that they wished, but it was possible that they collided with generated functions, leading to a broken build. This change performs a scan of the existing packages for any colliding function names or functions that already provide the call to mock.Expect. We naively assume that the result of the mock.Expect call is returned from the user defined function. If there is more than one call to a mock.Expect function within a single custom function then we ignore the custom function and generate functions as per normal. If there is a function that collides with a generated function name but does not make a call to a mock.Expect function then the generated function falls back to a more verbose name.
- Loading branch information
1 parent
0e5cd36
commit b75a1e6
Showing
8 changed files
with
746 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.