-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change ensures future modifications to FakeClock will not break users. Unfortunately, this change does break current users who use FakeClock as an argument, return value, or embed it in a struct or interface. With limtied exception, build errors can be fixed by running: ``` $ grep -rl 'clockwork.FakeClock' /path/to/code_base | \ xargs sed -i 's/clockwork.FakeClock/*clockwork.FakeClock/g' ``` Other rare build errors and their fixes are: - When returning a `clockwork.FakeClock`: return the pointer to concrete type instead. - When using `clockwork.FakeClock` as an argument, replace with concerete type or define a new interface. - When using `clockwork.FakeClock` in an interface composition: relace with the functions required by the interface. The anternative approach would have been to use type alaises. However, type alaises do not provide a benefit over direct replacement, because the migration is more complicated (multi-step), needs to be done to the same code points, and results in runtime failures when using type conversions (whereas direct replacement fails deterministically at complie-time).
- Loading branch information
Showing
4 changed files
with
58 additions
and
67 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
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