Skip to content

Commit

Permalink
Merge pull request #28 from carolynvs/update-mgx-doc
Browse files Browse the repository at this point in the history
Improve godoc for mgx package
  • Loading branch information
carolynvs committed Jul 25, 2022
2 parents eb350f0 + c086acb commit 8303d87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mgx/doc.go
@@ -0,0 +1,3 @@
// Package mgx provides helpers that complement the github.com/magefile/mage/mg package.
// They are general purpose functions that assist with writing magefiles.
package mgx
7 changes: 6 additions & 1 deletion mgx/must.go
Expand Up @@ -2,7 +2,12 @@ package mgx

import "github.com/magefile/mage/mg"

// Must stops the build when an error occurs.
// Must stops execution by throwing a panic when an error occurs.
//
// This may be used to keep your magefile brief, and mimic set -euo in an
// equivalent bash script. This pattern works well in magefile targets only, not
// helper functions. For helper functions, return an error so that you can write
// tests and allow the calling function to handle the error.
func Must(err error) {
if err != nil {
panic(mg.Fatal(1, err))
Expand Down

0 comments on commit 8303d87

Please sign in to comment.