From: Matt T. Proud Date: Sat, 28 Sep 2024 14:25:38 +0000 (+0000) Subject: errors: reference Go 1.13 article about errors X-Git-Tag: go1.24rc1~791 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1d0f5c478ac176fa99d0f3d6bd540e5fb422187a;p=gostls13.git errors: reference Go 1.13 article about errors This commit amends package errors' documentation to include a reference to the https://go.dev/blog/go1.13-errors blog article. The motivation is multi-fold, but chiefly the article includes good information about error philosophy (e.g., when to wrap), and developers who have come to Go in the intervening five years are likely not have seen this article at all given the nature of blog publishing and post fanfare. The material deserves a promotion in visibility. Change-Id: Ia6f8307784521dd59de3a3d638dbc0a7fcd445e6 GitHub-Last-Rev: 20980dd5070cde495ebb08386ae7b4cd78ccc612 GitHub-Pull-Request: golang/go#69698 Reviewed-on: https://go-review.googlesource.com/c/go/+/616341 Reviewed-by: Jonathan Amsterdam Reviewed-by: Damien Neil LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- diff --git a/src/errors/errors.go b/src/errors/errors.go index 9e3860aaa9..5059be12ed 100644 --- a/src/errors/errors.go +++ b/src/errors/errors.go @@ -26,6 +26,9 @@ // itself followed by the tree of each of its children in turn // (pre-order, depth-first traversal). // +// See https://go.dev/blog/go1.13-errors for a deeper discussion of the +// philosophy of wrapping and when to wrap. +// // [Is] examines the tree of its first argument looking for an error that // matches the second. It reports whether it finds a match. It should be // used in preference to simple equality checks: