Просмотр исходного кода

address spelling mistakes. Thanks @seh

Dave Cheney 10 лет назад
Родитель
Сommit
cd6e0b425d
2 измененных файлов с 7 добавлено и 7 удалено
  1. 3 3
      README.md
  2. 4 4
      errors.go

+ 3 - 3
README.md

@@ -19,17 +19,17 @@ if err != nil {
         return errors.Wrap(err, "read failed")
 }
 ```
-In addition, errors.Wrap records the file and line where it was called, allowing the programmer to retrieve the path to the original error.
+In addition, `errors.Wrap` records the file and line where it was called, allowing the programmer to retrieve the path to the original error.
 
 ## Retrieving the cause of an error
 
-Using errors.Wrap constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to recurse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface
+Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to recurse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`.
 ```
 type causer interface {
      Cause() error
 }
 ```
-Can be inspected by errors.Cause which will recursively retrieve the topmost error which does nor implement causer, which is assumed to be the original cause. For example:
+`errors.Cause` will recursively retrieve the topmost error which does nor implement causer, which is assumed to be the original cause. For example:
 ```
 switch err := errors.Cause(err).(type) {
 case *MyError:

+ 4 - 4
errors.go

@@ -28,16 +28,16 @@
 //
 // Using errors.Wrap constructs a stack of errors, adding context to the
 // preceding error. Depending on the nature of the error it may be necessary
-// to recerse the operation of errors.Wrap to retrieve the original error
+// to reverse the operation of errors.Wrap to retrieve the original error
 // for inspection. Any error value which implements this interface
 //
 //     type causer interface {
 //          Cause() error
 //     }
 //
-// Can be inspected by errors.Cause which will recursively retrieve the topmost
-// error which does nor implement causer, which is assumed to be the original
-// cause. For example:
+// can be inspected by errors.Cause. errors.Cause will recursively retrieve
+// the topmost error which does nor implement causer, which is assumed to be
+// the original cause. For example:
 //
 //     switch err := errors.Cause(err).(type) {
 //     case *MyError: