From c0fd7f79fe445ad49e11bf42c8c785cb71b3bedf Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 30 Mar 2023 16:00:15 +0000 Subject: errors: improve the godoc for Join and Unwrap Document that errors returned by Join always implement Unwrap []error. Explicitly state that Unwrap does not unwrap errors with an Unwrap() []error method. Change-Id: Id610345dcf43ca54a9dde157e56c5815c5112073 GitHub-Last-Rev: 7a0ec450bd0b2b38eecb5b94eaec485f4a6debbd GitHub-Pull-Request: golang/go#59301 Reviewed-on: https://go-review.googlesource.com/c/go/+/480021 Run-TryBot: Emmanuel Odeke Auto-Submit: Emmanuel Odeke Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Damien Neil --- src/errors/join.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/errors/join.go') diff --git a/src/errors/join.go b/src/errors/join.go index 329082a5e3..1c486d591e 100644 --- a/src/errors/join.go +++ b/src/errors/join.go @@ -10,6 +10,8 @@ package errors // The error formats as the concatenation of the strings obtained // by calling the Error method of each element of errs, with a newline // between each string. +// +// A non-nil error returned by Join implements the Unwrap() []error method. func Join(errs ...error) error { n := 0 for _, err := range errs { -- cgit v1.3