Skip to content

Commit 6838e7a

Browse files
author
Alexandru Efimov
committed
fix readme
1 parent 9d0c4dc commit 6838e7a

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ An error implementation with StatusCode and Stacktrace
77
## Install
88

99
```console
10-
$ go get github.com/tools/godep
10+
$ go get github.com/efimovalex/stackerr
1111
```
1212

1313
## Usage
@@ -16,6 +16,7 @@ $ go get github.com/tools/godep
1616
package main
1717

1818
import "github.com/efimovalex/stackerr"
19+
import "fmt"
1920

2021
func f1() *stackerr.Err {
2122
err := stackerr.Error("message")
@@ -38,17 +39,29 @@ func main() {
3839
ts := t1{}
3940
err := ts.f3()
4041

42+
fmt.Println(err.Sprint())
43+
44+
fmt.Println(err.Error())
45+
4146
err.Log()
4247
}
4348
```
4449
Output:
4550

4651
```console
47-
2017/08/31 11:59:54 Error Stacktrace:
48-
-> github.com/efimovalex/stackerr/example/main.go:24 (main.main)
49-
-> github.com/efimovalex/stackerr/example/main.go:18 (main.(*t1).f3)
50-
-> github.com/efimovalex/stackerr/example/main.go:11 (main.f2)
51-
-> github.com/efimovalex/stackerr/example/main.go:6 (main.f1)
52+
Error Stacktrace:
53+
-> github.com/efimovalex/stackerr/example/main.go:25 (main.main)
54+
-> github.com/efimovalex/stackerr/example/main.go:19 (main.(*t1).f3)
55+
-> github.com/efimovalex/stackerr/example/main.go:12 (main.f2)
56+
-> github.com/efimovalex/stackerr/example/main.go:7 (main.f1)
57+
58+
message
59+
60+
2017/08/31 12:13:47 Error Stacktrace:
61+
-> github.com/efimovalex/stackerr/example/main.go:25 (main.main)
62+
-> github.com/efimovalex/stackerr/example/main.go:19 (main.(*t1).f3)
63+
-> github.com/efimovalex/stackerr/example/main.go:12 (main.f2)
64+
-> github.com/efimovalex/stackerr/example/main.go:7 (main.f1)
5265
```
5366
## Authors
5467

0 commit comments

Comments
 (0)