mirror of
https://github.com/go-task/task.git
synced 2026-08-29 10:08:27 +02:00
chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920)
This commit is contained in:
@@ -67,6 +67,13 @@ func As(err error, target any) bool {
|
||||
return errors.As(err, target)
|
||||
}
|
||||
|
||||
// AsType wraps the standard errors.AsType function so that we don't need to alias
|
||||
// that package. It returns the first error in err's tree that matches type T, and
|
||||
// whether such an error was found.
|
||||
func AsType[T error](err error) (T, bool) {
|
||||
return errors.AsType[T](err)
|
||||
}
|
||||
|
||||
// Unwrap wraps the standard errors.Unwrap function so that we don't need to alias that package.
|
||||
func Unwrap(err error) error {
|
||||
return errors.Unwrap(err)
|
||||
|
||||
Reference in New Issue
Block a user