]> Cypherpunks.ru repositories - gostls13.git/commitdiff
errors: add available godoc link
authorcui fliter <imcusg@gmail.com>
Fri, 13 Oct 2023 06:59:10 +0000 (14:59 +0800)
committerCherry Mui <cherryyz@google.com>
Thu, 2 Nov 2023 19:45:41 +0000 (19:45 +0000)
Change-Id: Ie86493ebad3c3d7ea914754451985d7ee3e8e270
Reviewed-on: https://go-review.googlesource.com/c/go/+/535080
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: qiulaidongfeng <2645477756@qq.com>
src/errors/errors.go
src/errors/wrap.go

index 41397774d304a56b0912dca2b88585761b87586f..9e3860aaa9946fb526ee7de12b9b735511e3e3b3 100644 (file)
@@ -26,7 +26,7 @@
 // itself followed by the tree of each of its children in turn
 // (pre-order, depth-first traversal).
 //
-// Is examines the tree of its first argument looking for an error that
+// [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:
 //
@@ -38,7 +38,7 @@
 //
 // because the former will succeed if err wraps [io/fs.ErrExist].
 //
-// As examines the tree of its first argument looking for an error that can be
+// [As] examines the tree of its first argument looking for an error that can be
 // assigned to its second argument, which must be a pointer. If it succeeds, it
 // performs the assignment and returns true. Otherwise, it returns false. The form
 //
@@ -80,7 +80,7 @@ func (e *errorString) Error() string {
 //
 //     errors.Is(err, errors.ErrUnsupported)
 //
-// either by directly wrapping ErrUnsupported or by implementing an Is method.
+// either by directly wrapping ErrUnsupported or by implementing an [Is] method.
 //
 // Functions and methods should document the cases in which an error
 // wrapping this will be returned.
index 756de6cc1c565a0467c3e915e3a45b6f1bedd3f0..e1cc466eeaa67ad659268fb9a4ff35bcb3843a14 100644 (file)
@@ -27,7 +27,7 @@ func Unwrap(err error) error {
 // Is reports whether any error in err's tree matches target.
 //
 // The tree consists of err itself, followed by the errors obtained by repeatedly
-// calling Unwrap. When err wraps multiple errors, Is examines err followed by a
+// calling [Unwrap]. When err wraps multiple errors, Is examines err followed by a
 // depth-first traversal of its children.
 //
 // An error is considered to match a target if it is equal to that target or if
@@ -40,7 +40,7 @@ func Unwrap(err error) error {
 //
 // then Is(MyError{}, fs.ErrExist) returns true. See [syscall.Errno.Is] for
 // an example in the standard library. An Is method should only shallowly
-// compare err and the target and not call Unwrap on either.
+// compare err and the target and not call [Unwrap] on either.
 func Is(err, target error) bool {
        if target == nil {
                return err == target
@@ -81,7 +81,7 @@ func is(err, target error, targetComparable bool) bool {
 // target to that error value and returns true. Otherwise, it returns false.
 //
 // The tree consists of err itself, followed by the errors obtained by repeatedly
-// calling Unwrap. When err wraps multiple errors, As examines err followed by a
+// calling [Unwrap]. When err wraps multiple errors, As examines err followed by a
 // depth-first traversal of its children.
 //
 // An error matches target if the error's concrete value is assignable to the value