Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 2233dee

Browse files
sehdavecheney
authored andcommitted
Copyedit the package documentation (#135)
Remove spurious words, add missing words, and smooth out a few sentences.
1 parent e981d1a commit 2233dee

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

errors.go

+15-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// return err
77
// }
88
//
9-
// which applied recursively up the call stack results in error reports
9+
// which when applied recursively up the call stack results in error reports
1010
// without context or debugging information. The errors package allows
1111
// programmers to add context to the failure path in their code in a way
1212
// that does not destroy the original value of the error.
@@ -15,16 +15,17 @@
1515
//
1616
// The errors.Wrap function returns a new error that adds context to the
1717
// original error by recording a stack trace at the point Wrap is called,
18-
// and the supplied message. For example
18+
// together with the supplied message. For example
1919
//
2020
// _, err := ioutil.ReadAll(r)
2121
// if err != nil {
2222
// return errors.Wrap(err, "read failed")
2323
// }
2424
//
25-
// If additional control is required the errors.WithStack and errors.WithMessage
26-
// functions destructure errors.Wrap into its component operations of annotating
27-
// an error with a stack trace and an a message, respectively.
25+
// If additional control is required, the errors.WithStack and
26+
// errors.WithMessage functions destructure errors.Wrap into its component
27+
// operations: annotating an error with a stack trace and with a message,
28+
// respectively.
2829
//
2930
// Retrieving the cause of an error
3031
//
@@ -38,7 +39,7 @@
3839
// }
3940
//
4041
// can be inspected by errors.Cause. errors.Cause will recursively retrieve
41-
// the topmost error which does not implement causer, which is assumed to be
42+
// the topmost error that does not implement causer, which is assumed to be
4243
// the original cause. For example:
4344
//
4445
// switch err := errors.Cause(err).(type) {
@@ -48,30 +49,30 @@
4849
// // unknown error
4950
// }
5051
//
51-
// causer interface is not exported by this package, but is considered a part
52-
// of stable public API.
52+
// Although the causer interface is not exported by this package, it is
53+
// considered a part of its stable public interface.
5354
//
5455
// Formatted printing of errors
5556
//
5657
// All error values returned from this package implement fmt.Formatter and can
57-
// be formatted by the fmt package. The following verbs are supported
58+
// be formatted by the fmt package. The following verbs are supported:
5859
//
5960
// %s print the error. If the error has a Cause it will be
60-
// printed recursively
61+
// printed recursively.
6162
// %v see %s
6263
// %+v extended format. Each Frame of the error's StackTrace will
6364
// be printed in detail.
6465
//
6566
// Retrieving the stack trace of an error or wrapper
6667
//
6768
// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
68-
// invoked. This information can be retrieved with the following interface.
69+
// invoked. This information can be retrieved with the following interface:
6970
//
7071
// type stackTracer interface {
7172
// StackTrace() errors.StackTrace
7273
// }
7374
//
74-
// Where errors.StackTrace is defined as
75+
// The returned errors.StackTrace type is defined as
7576
//
7677
// type StackTrace []Frame
7778
//
@@ -85,8 +86,8 @@
8586
// }
8687
// }
8788
//
88-
// stackTracer interface is not exported by this package, but is considered a part
89-
// of stable public API.
89+
// Although the stackTracer interface is not exported by this package, it is
90+
// considered a part of its stable public interface.
9091
//
9192
// See the documentation for Frame.Format for more details.
9293
package errors

0 commit comments

Comments
 (0)