chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920)

This commit is contained in:
Valentin Maerten
2026-08-20 12:24:04 +02:00
committed by GitHub
parent 325e3188f0
commit dd4463ec60
21 changed files with 76 additions and 73 deletions

View File

@@ -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)