diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-12 12:15:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-12 12:15:27 -0500 |
commit | fc02d16e728dfdd5a5f2e3bc622bbceb7f8c0d24 (patch) | |
tree | ea1036f8e3e8b2263df5383a1c017928e2f494ff /vendor/github.com/magefile/mage/mg/errors.go | |
parent | 605df430d90029b9b7b430c78691425410544509 (diff) | |
parent | 12fb9e46538621ed494f692085e3c567822262da (diff) | |
download | podman-fc02d16e728dfdd5a5f2e3bc622bbceb7f8c0d24.tar.gz podman-fc02d16e728dfdd5a5f2e3bc622bbceb7f8c0d24.tar.bz2 podman-fc02d16e728dfdd5a5f2e3bc622bbceb7f8c0d24.zip |
Merge pull request #9684 from containers/dependabot/go_modules/github.com/sirupsen/logrus-1.8.1
Bump github.com/sirupsen/logrus from 1.8.0 to 1.8.1
Diffstat (limited to 'vendor/github.com/magefile/mage/mg/errors.go')
-rw-r--r-- | vendor/github.com/magefile/mage/mg/errors.go | 51 |
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 2dd780fe3..000000000 --- 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() -} |