summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/magefile/mage/mg/errors.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-04-03 19:16:46 +0200
committerGitHub <noreply@github.com>2021-04-03 19:16:46 +0200
commit21eb37e471c338a90f2e23c86106f7e49e2d1196 (patch)
treee7d1cfa89f31fcf0578edae7727f2230bba744a2 /vendor/github.com/magefile/mage/mg/errors.go
parentd3b60cc445e5871971b543fde9483dba3924bf68 (diff)
downloadmatterbridge-msglm-21eb37e471c338a90f2e23c86106f7e49e2d1196.tar.gz
matterbridge-msglm-21eb37e471c338a90f2e23c86106f7e49e2d1196.tar.bz2
matterbridge-msglm-21eb37e471c338a90f2e23c86106f7e49e2d1196.zip
Update vendor (#1446)
* Update vendor * Use upstream emoji lib again
Diffstat (limited to 'vendor/github.com/magefile/mage/mg/errors.go')
-rw-r--r--vendor/github.com/magefile/mage/mg/errors.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/vendor/github.com/magefile/mage/mg/errors.go b/vendor/github.com/magefile/mage/mg/errors.go
deleted file mode 100644
index 2dd780fe..00000000
--- a/vendor/github.com/magefile/mage/mg/errors.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package mg
-
-import (
- "errors"
- "fmt"
-)
-
-type fatalErr struct {
- code int
- error
-}
-
-func (f fatalErr) ExitStatus() int {
- return f.code
-}
-
-type exitStatus interface {
- ExitStatus() int
-}
-
-// Fatal returns an error that will cause mage to print out the
-// given args and exit with the given exit code.
-func Fatal(code int, args ...interface{}) error {
- return fatalErr{
- code: code,
- error: errors.New(fmt.Sprint(args...)),
- }
-}
-
-// Fatalf returns an error that will cause mage to print out the
-// given message and exit with the given exit code.
-func Fatalf(code int, format string, args ...interface{}) error {
- return fatalErr{
- code: code,
- error: fmt.Errorf(format, args...),
- }
-}
-
-// ExitStatus queries the error for an exit status. If the error is nil, it
-// returns 0. If the error does not implement ExitStatus() int, it returns 1.
-// Otherwise it retiurns the value from ExitStatus().
-func ExitStatus(err error) int {
- if err == nil {
- return 0
- }
- exit, ok := err.(exitStatus)
- if !ok {
- return 1
- }
- return exit.ExitStatus()
-}