diff options
| author | Damien Neil <dneil@google.com> | 2019-05-13 14:51:55 -0700 |
|---|---|---|
| committer | Damien Neil <dneil@google.com> | 2019-05-15 19:53:15 +0000 |
| commit | 3e2c522d5c712fa2b1d18a101272abefc7dcb074 (patch) | |
| tree | ff30ae55319bd82eb832829a2c65c252d3969abb /src/fmt/doc.go | |
| parent | 599ec7720fefdb60344bb4a9dab481ed302aa473 (diff) | |
| download | go-3e2c522d5c712fa2b1d18a101272abefc7dcb074.tar.xz | |
errors, fmt: revert rejected changes for Go 1.13
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>
Diffstat (limited to 'src/fmt/doc.go')
| -rw-r--r-- | src/fmt/doc.go | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/fmt/doc.go b/src/fmt/doc.go index b784399e0d..a7115809d3 100644 --- a/src/fmt/doc.go +++ b/src/fmt/doc.go @@ -149,28 +149,20 @@ 1. If the operand is a reflect.Value, the operand is replaced by the concrete value that it holds, and printing continues with the next rule. - 2. If an operand implements the Formatter interface, and not - errors.Formatter, it will be invoked. Formatter provides fine - control of formatting. + 2. If an operand implements the Formatter interface, it will + be invoked. Formatter provides fine control of formatting. 3. If the %v verb is used with the # flag (%#v) and the operand implements the GoStringer interface, that will be invoked. If the format (which is implicitly %v for Println etc.) is valid - for a string (%s %q %v %x %X), the following three rules apply: + for a string (%s %q %v %x %X), the following two rules apply: - 4. If an operand implements errors.Formatter, the FormatError - method will be invoked with an errors.Printer to print the error. - If the %v flag is used with the + flag (%+v), the Detail method - of the Printer will return true and the error will be formatted - as a detailed error message. Otherwise the printed string will - be formatted as required by the verb (if any). - - 5. If an operand implements the error interface, the Error method + 4. If an operand implements the error interface, the Error method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any). - 6. If an operand implements method String() string, that method + 5. If an operand implements method String() string, that method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any). |
