-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
go generate
directives for mock generation
Instead of adding commands to the Makefile, use go generate directives on top of the interfaces we need mocks for. This approach has the following advantages: 1) Less context switching: you can declare the need for a mock in the code and not have to edit the makefiles. 2) The same directive can be reused everywhere - you no longer need to specify the filepath, interface name and the path to the generated mock. 3) If the interface is renamed or moved, the code generation will still work without modification. I have left some commands in the makefile for generating mocks from code in `pkg`, and from autogenerated code. We could in theory get rid of these usages as well, but I did not feel there was much point at this time since they are edge cases.
- Loading branch information
Showing
34 changed files
with
781 additions
and
386 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.