Skip to content

Commit b96f02b

Browse files
committed
Update readme
1 parent 13fe445 commit b96f02b

1 file changed

Lines changed: 19 additions & 19 deletions

File tree

‎README.md‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,6 @@ func Process() error {
4444
}
4545
```
4646

47-
Print the message alone with `%v`, or the fields, the cause and the stack trace with `%+v`:
48-
49-
```go
50-
fmt.Printf("%+v", err)
51-
// process failed
52-
// process=abc
53-
// caused by: connection refused
54-
// main.Process
55-
// /app/main.go:14
56-
```
57-
58-
Walk the captured stack yourself with `Frames`:
59-
60-
```go
61-
for frame := range err.Frames() {
62-
fmt.Println(frame.Function, frame.File, frame.Line)
63-
}
64-
```
65-
6647
```go
6748
import (
6849
"sync"
@@ -96,6 +77,25 @@ func ProcessConcurrent() error {
9677
}
9778
```
9879

80+
Print the message alone with `%v`, or the fields, the cause and the stack trace with `%+v`:
81+
82+
```go
83+
fmt.Printf("%+v", err)
84+
// process failed
85+
// process=abc
86+
// caused by: connection refused
87+
// main.Process
88+
// /app/main.go:14
89+
```
90+
91+
Walk the captured stack yourself with `Frames`:
92+
93+
```go
94+
for frame := range err.Frames() {
95+
fmt.Println(frame.Function, frame.File, frame.Line)
96+
}
97+
```
98+
9999

100100
## Credits
101101

0 commit comments

Comments
 (0)