diff options
author | Ian Lance Taylor <iant@golang.org> | 2019-09-05 13:24:26 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2019-09-06 00:03:32 +0000 |
commit | c99598cbd3aa5eab2971ee449b5685f299b89755 (patch) | |
tree | 868070184346e31d24db83603df325793d83ab4e /src/errors | |
parent | 2b6b474f64d8f21d911910b04ef5a806ee37b154 (diff) | |
download | go-git-c99598cbd3aa5eab2971ee449b5685f299b89755.tar.gz |
errors: clarify docs for when As returns false
Change-Id: Ic8d8399f726c1f9376499fdae92bea41632586ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/193602
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'src/errors')
-rw-r--r-- | src/errors/wrap.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/errors/wrap.go b/src/errors/wrap.go index 65e6c44853..688c585396 100644 --- a/src/errors/wrap.go +++ b/src/errors/wrap.go @@ -59,7 +59,7 @@ func Is(err, target error) bool { } // As finds the first error in err's chain that matches target, and if so, sets -// target to that error value and returns true. +// target to that error value and returns true. Otherwise, it returns false. // // The chain consists of err itself followed by the sequence of errors obtained by // repeatedly calling Unwrap. @@ -73,7 +73,7 @@ func Is(err, target error) bool { // a different error type. // // As panics if target is not a non-nil pointer to either a type that implements -// error, or to any interface type. As returns false if err is nil. +// error, or to any interface type. func As(err error, target interface{}) bool { if target == nil { panic("errors: target cannot be nil") |