Skip to content

Instantly share code, notes, and snippets.

@pprishchepa
Created March 12, 2023 17:23
Show Gist options
  • Save pprishchepa/f8cffe4ff191d3154b26f462cfca7036 to your computer and use it in GitHub Desktop.
Save pprishchepa/f8cffe4ff191d3154b26f462cfca7036 to your computer and use it in GitHub Desktop.
package main
import (
"errors"
)
func UnwrapAll(err error) error {
var e error
for {
if e = errors.Unwrap(err); e == nil {
return err
}
err = e
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment