File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ // Package mgx provides helpers that complement the github.com/magefile/mage/mg package.
2+ // They are general purpose functions that assist with writing magefiles.
3+ package mgx
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ package mgx
22
33import "github.com/magefile/mage/mg"
44
5- // Must stops the build when an error occurs.
5+ // Must stops execution by throwing a panic when an error occurs.
6+ //
7+ // This may be used to keep your magefile brief, and mimic set -euo in an
8+ // equivalent bash script. This pattern works well in magefile targets only, not
9+ // helper functions. For helper functions, return an error so that you can write
10+ // tests and allow the calling function to handle the error.
611func Must (err error ) {
712 if err != nil {
813 panic (mg .Fatal (1 , err ))
You can’t perform that action at this time.
0 commit comments