Ver Fonte

Documentation improvements (#69)

* Add install instructions.

* Document that causer and stackTracer are stable.
Alexey Palazhchenko há 9 anos atrás
pai
commit
cc5fbb72d9
2 ficheiros alterados com 10 adições e 2 exclusões
  1. 2 0
      README.md
  2. 8 2
      errors.go

+ 2 - 0
README.md

@@ -2,6 +2,8 @@
 
 Package errors provides simple error handling primitives.
 
+`go get github.com/pkg/errors`
+
 The traditional error handling idiom in Go is roughly akin to
 ```go
 if err != nil {

+ 8 - 2
errors.go

@@ -28,7 +28,7 @@
 // to reverse the operation of errors.Wrap to retrieve the original error
 // for inspection. Any error value which implements this interface
 //
-//     type Causer interface {
+//     type causer interface {
 //             Cause() error
 //     }
 //
@@ -43,6 +43,9 @@
 //             // unknown error
 //     }
 //
+// causer interface is not exported by this package, but is considered a part
+// of stable public API.
+//
 // Formatted printing of errors
 //
 // All error values returned from this package implement fmt.Formatter and can
@@ -77,6 +80,9 @@
 //             }
 //     }
 //
+// stackTracer interface is not exported by this package, but is considered a part
+// of stable public API.
+//
 // See the documentation for Frame.Format for more details.
 package errors
 
@@ -191,7 +197,7 @@ func Wrapf(err error, format string, args ...interface{}) error {
 // An error value has a cause if it implements the following
 // interface:
 //
-//     type Causer interface {
+//     type causer interface {
 //            Cause() error
 //     }
 //