From 1d0f5c478ac176fa99d0f3d6bd540e5fb422187a Mon Sep 17 00:00:00 2001 From: "Matt T. Proud" Date: Sat, 28 Sep 2024 14:25:38 +0000 Subject: [PATCH] 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 --- src/errors/errors.go | 3 +++ 1 file changed, 3 insertions(+) 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: -- 2.48.1