Created
March 12, 2023 17:23
-
-
Save pprishchepa/f8cffe4ff191d3154b26f462cfca7036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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