Add basic test for hooks by timvaillancourt · Pull Request #1179 · github/gh-ost
Description
This PR adds a simple test for go/logic/hooks.go
In the process I found that the initHooks() func of HooksExecutor has a static return nil and no other logic, making it fairly useless. migrator.initiateHooksExecutor() was modified to remove the call to initHooks(), making it unnecessary as well. HooksExecutor is now instantiated in NewMigrator to simplify the code
Lastly, executeHooks() and executeHook() (from HooksExecutor) were updated to use an out io.Writer for output to facilitate testing
In case this PR introduced Go code changes:
- contributed code is using same conventions as original code
-
script/cibuildreturns with no formatting errors, build errors or unit test errors.