Skip to content

Commit

Permalink
fix into doc
Browse files Browse the repository at this point in the history
  • Loading branch information
peczenyj committed Nov 10, 2023
1 parent ab920da commit bd5461c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions into.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import "errors"
// Into finds the first error in err's chain that matches target type T, and if so, returns it.
//
// Into is type-safe alternative to As.
//
// this function was ported from
// https://github.com/go-faster/errors
func Into[T error](err error) (val T, ok bool) { //nolint: ireturn
ok = errors.As(err, &val)

Expand Down

0 comments on commit bd5461c

Please sign in to comment.