From 474d3c911e664dcda0ae9133a70f976286dd7b64 Mon Sep 17 00:00:00 2001 From: Jonathan Amsterdam Date: Fri, 22 Mar 2019 16:26:53 -0400 Subject: [PATCH] Updated ErrorValueFAQ (markdown) --- ErrorValueFAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ErrorValueFAQ.md b/ErrorValueFAQ.md index 63e76df3..c871cf9b 100644 --- a/ErrorValueFAQ.md +++ b/ErrorValueFAQ.md @@ -26,7 +26,7 @@ You need to be prepared that errors you get may be wrapped. ``` becomes ``` - e := &os.PathError{} + var e *s.PathError if xerrors.As(err, &e) ``` - Also use this pattern to check whether an error implements an interface. (This is one of those rare cases when a pointer to an interface is appropriate.)