summaryrefslogtreecommitdiff
path: root/src/errors/wrap.go
Commit message (Collapse)AuthorAgeFilesLines
* errors/wrap: do not call Elem() twiceVitaly Zdanevich2021-03-131-2/+2
| | | | | | | | | | | Change-Id: I2fe6037c45a0dfe25f946a92ff97b5e3fbd69bc0 GitHub-Last-Rev: 644d479a27c0eccfc0b37e1a560ca09e47b5a972 GitHub-Pull-Request: golang/go#44851 Reviewed-on: https://go-review.googlesource.com/c/go/+/299629 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Tobias Klauser <tobias.klauser@gmail.com>
* all: update references to symbols moved from os to io/fsRuss Cox2020-10-201-2/+2
| | | | | | | | | | | | | | | | | | The old os references are still valid, but update our code to reflect best practices and get used to the new locations. Code compiled with the bootstrap toolchain (cmd/asm, cmd/dist, cmd/compile, debug/elf) must remain Go 1.4-compatible and is excluded. For #41190. Change-Id: I8f9526977867c10a221e2f392f78d7dec073f1bd Reviewed-on: https://go-review.googlesource.com/c/go/+/243907 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org>
* errors: fix typo in As documentationYann Salaün2020-03-091-1/+1
| | | | | | | | Change-Id: Ia26b4457aa0780171a636df93f8d210de0278ec5 GitHub-Last-Rev: 577a6fec336010cb56a547bf2d6304fd3e0cb257 GitHub-Pull-Request: golang/go#37760 Reviewed-on: https://go-review.googlesource.com/c/go/+/222621 Reviewed-by: Ian Lance Taylor <iant@golang.org>
* errors: fix typo in TODO commentdavidsbond2019-10-111-1/+1
| | | | | | | | | Fixes #34846 Change-Id: I24b3e65fc96ec85b2821480e9396c9d1663611c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/200678 Run-TryBot: Johan Brandhorst <johan.brandhorst@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Johan Brandhorst <johan.brandhorst@gmail.com>
* errors: clarify docs for when As returns falseIan Lance Taylor2019-09-061-2/+2
| | | | | | Change-Id: Ic8d8399f726c1f9376499fdae92bea41632586ff Reviewed-on: https://go-review.googlesource.com/c/go/+/193602 Reviewed-by: Jonathan Amsterdam <jba@google.com>
* errors: document Is and As methodsJonathan Amsterdam2019-08-271-1/+12
| | | | | | | | | | | | | | Add brief descriptions of why one might implement an Is or As method. Fixes #33364. Change-Id: I81a091bf564c654ddb9ef3997e780451a01efb7a Reviewed-on: https://go-review.googlesource.com/c/go/+/191338 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Andrew Bonventre <andybons@golang.org> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
* errors: improve docJonathan Amsterdam2019-08-061-0/+6
| | | | | | | | | | | | Explain wrapping and how to use Is and As in the package doc. Explain "chain" in Is and As. Updates #33364. Change-Id: Ic06362106dbd129e33dd47e63176ee5355492086 Reviewed-on: https://go-review.googlesource.com/c/go/+/188737 Reviewed-by: Rob Pike <r@golang.org>
* errors: clarify doc for AsJonathan Amsterdam2019-06-111-8/+9
| | | | | | Change-Id: I389d140e8fd2849e4dc438246add47819f6b25a3 Reviewed-on: https://go-review.googlesource.com/c/go/+/181300 Reviewed-by: Bryan C. Mills <bcmills@google.com>
* errors: remove mention of Wrapper interfaceDamien Neil2019-05-221-2/+3
| | | | | | | | The Wrapper type no longer exists. Change-Id: I21051f26c6722a957295819f2f385f2bbd0db355 Reviewed-on: https://go-review.googlesource.com/c/go/+/177618 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* errors, fmt: revert rejected changes for Go 1.13Damien Neil2019-05-151-26/+3
| | | | | | | | | | | | | | | | | | | | | | | Reverts the following changes: https://go.googlesource.com/go/+/1f90d081391d4f5911960fd28d81d7ea5e554a8f https://go.googlesource.com/go/+/8bf18b56a47a98b9dd2fa03beb358312237a8c76 https://go.googlesource.com/go/+/5402854c3557f87fa2741a52ffc15dfb1ef333cc https://go.googlesource.com/go/+/37f84817247d3b8e687a701ccb0d6bc7ffe3cb78 https://go.googlesource.com/go/+/6be6f114e0d483a233101a67c9644cd72bd3ae7a Partially reverts the followinng change, removing the errors.Opaque function and the errors.Wrapper type definition: https://go.googlesource.com/go/+/62f5e8156ef56fa61e6af56f4ccc633bde1a9120 Updates documentation referencing the Wrapper type. Change-Id: Ia622883e39cafb06809853e3fd90b21441124534 Reviewed-on: https://go-review.googlesource.com/c/go/+/176997 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
* errors: remove useless condition checking in IsLE Manh Cuong2019-05-131-1/+1
| | | | | | | | | | | golang.org/cl/175260 fixed Is panics if target is uncomparable. It did add an useless condition checking whether target is comparable. Just remove that condition. Change-Id: I0a317056479638d209b0a0cbc7010c153558c087 Reviewed-on: https://go-review.googlesource.com/c/go/+/176497 Reviewed-by: Joan Lopez de la Franca Beltran <joanjan14@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* errors: fix Is panics if target is uncomparableLE Manh Cuong2019-05-061-1/+3
| | | | | | | | | | | Fixes #31841 Change-Id: I3f068686154fd2fa5755b0df47b4eaa5c9a19107 Reviewed-on: https://go-review.googlesource.com/c/go/+/175260 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* errors: fix comment referencing the Wrapper interfaceJacob Walker2019-05-021-1/+1
| | | | | | | | | | | | The Unwrap function performs a type assertion looking for the Wrapper interface. The method of that interface is called Unwrap but the interface itself is called Wrapper. Change-Id: Ie3bf296f93b773d36015bcab2a0e6585d39783c7 GitHub-Last-Rev: 32b1a0c2f8bf8f3eaebf6de252571d82313e86e0 GitHub-Pull-Request: golang/go#31794 Reviewed-on: https://go-review.googlesource.com/c/go/+/174917 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
* errors: return false if nil error is passed to AsAhsun Ahmed2019-04-101-5/+4
| | | | | | | | | | Fixes #30970 Change-Id: I333676b55a2364e329fffeafca8fc57d45a0b84b Reviewed-on: https://go-review.googlesource.com/c/go/+/168598 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org> Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
* errors: add Unwrap, Is, and AsMarcel van Lohuizen2019-02-271-0/+106
Unwrap, Is and As are as defined in proposal Issue #29934. Also add Opaque for enforcing an error cannot be unwrapped. Change-Id: I4f3feaa42e3ee7477b588164ac622ba4d5e77cad Reviewed-on: https://go-review.googlesource.com/c/163558 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> Reviewed-by: Damien Neil <dneil@google.com>