-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nil checks and improve error message
The new mg.F function is the root of the nil-pointer error that can happen when someone accidentally calls mg.Deps(TargetA()). I have fixed the check for whether a function was passed so that it won't panic. I then added a similar check, is the target a function, to Deps/SerialDeps/CxtSerialDeps functions so that we can give a better error message when it's passed a non-function. The error message otherwise will reference mg.F which I don't think will help point people to the real problem, which is how they called mg.Deps/SerialDeps. Signed-off-by: Carolyn Van Slyck <[email protected]>
- Loading branch information
Showing
3 changed files
with
9 additions
and
5 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