Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve godoc for mgx package #28

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mgx/doc.go
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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