Skip to content

Commit c086acb

Browse files
committed
Improve godoc for mgx package
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
1 parent eb350f0 commit c086acb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

mgx/doc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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

mgx/must.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ package mgx
22

33
import "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.
611
func Must(err error) {
712
if err != nil {
813
panic(mg.Fatal(1, err))

0 commit comments

Comments
 (0)