diff --git a/doc/go1.13.html b/doc/go1.13.html index bc44531133..f38474b327 100644 --- a/doc/go1.13.html +++ b/doc/go1.13.html @@ -525,6 +525,37 @@ godoc crypto/ed25519 when used with Go 1.13+.

+

Error wrapping

+ +

+ Go 1.13 contains support for error wrapping, as first proposed in + the + Error Values proposal and discussed on the + associated issue. +

+

+ An error e can wrap another error w by providing + an Unwrap method that returns w. Both e + and w are available to programs, allowing e to provide + additional context to w or to reinterpret it while still allowing + programs to make decisions based on w. +

+

+ To support wrapping, fmt.Errorf now has a %w + verb for creating wrapped errors, and three new functions in + the errors package ( + errors.Unwrap, + errors.Is and + errors.As) simplify unwrapping + and inspecting wrapped errors. +

+

+ For more information, read the errors package + documentation, or see + the Error Value FAQ. + There will soon be a blog post as well. +

+

Minor changes to the library

@@ -612,7 +643,8 @@ godoc

- The new function As finds the first error in a given error’s chain + The new function As finds the first + error in a given error’s chain (sequence of wrapped errors) that matches a given target’s type, and if so, sets the target to that error value.