Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit 5ad9aa9

Browse files
Merge pull request #5 from goinsane/develop
v1.0.3
2 parents 541ddde + 736d68f commit 5ad9aa9

File tree

3 files changed

+15
-22
lines changed

3 files changed

+15
-22
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44

55
Package erf provides error management with stack trace.
66
Erf is an error type that wraps the underlying error that stores and formats the stack trace.
7-
Please see [godoc](https://pkg.go.dev/github.com/goinsane/erf) and [examples](https://github.com/goinsane/erf/tree/master/examples).
7+
Please see [godoc](https://pkg.go.dev/github.com/goinsane/erf).
8+
9+
## Examples
10+
11+
To run any example, please use the command like the following:
12+
13+
> go run examples/example1.go

examples/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/example1.go

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,51 +40,43 @@ func Baz(z int) error {
4040
}
4141

4242
func main() {
43-
fmt.Println("### Foo: just show error text")
43+
fmt.Println("#### Foo: just show error text")
4444
if err := Foo(-1); err != nil {
4545
fmt.Printf("%v\n", err)
4646
}
47-
fmt.Printf("### \n\n")
4847

49-
fmt.Println("### Foo: show with stack trace")
48+
fmt.Println("#### Foo: show with stack trace")
5049
if err := Foo(-2); err != nil {
5150
fmt.Printf("%+v\n", err)
5251
}
53-
fmt.Printf("### \n\n")
5452

55-
fmt.Println("### Foo: show with stack trace, and use space as whitespace instead of tab")
53+
fmt.Println("#### Foo: show with stack trace, and use space as whitespace instead of tab")
5654
if err := Foo(-3); err != nil {
5755
fmt.Printf("%+-v\n", err)
5856
}
59-
fmt.Printf("### \n\n")
6057

61-
fmt.Println("### Foo: show with last stack trace")
58+
fmt.Println("#### Foo: show with last stack trace")
6259
if err := Foo(-4); err != nil {
6360
fmt.Printf("%+0v\n", err)
6461
}
65-
fmt.Printf("### \n\n")
6662

67-
fmt.Println("### Foo: show with stack trace with only file names except full path")
63+
fmt.Println("#### Foo: show with stack trace with only file names except full path")
6864
if err := Foo(-5); err != nil {
6965
fmt.Printf("%+#v\n", err)
7066
}
71-
fmt.Printf("### \n\n")
7267

73-
fmt.Println("### Foo: show with stack trace with 2 whitespace chars of padding and 1 whitespace char of indent")
68+
fmt.Println("#### Foo: show with stack trace with 2 whitespace chars of padding and 1 whitespace char of indent")
7469
if err := Foo(-6); err != nil {
7570
fmt.Printf("%+2.1v\n", err)
7671
}
77-
fmt.Printf("### \n\n")
7872

79-
fmt.Println("### Bar: show with stack trace")
73+
fmt.Println("#### Bar: show with stack trace")
8074
if err := Bar(-7); err != nil {
8175
fmt.Printf("%+v\n", err)
8276
}
83-
fmt.Printf("### \n\n")
8477

85-
fmt.Println("### Baz: show with stack trace")
78+
fmt.Println("#### Baz: show with stack trace")
8679
if err := Baz(-8); err != nil {
8780
fmt.Printf("%+v\n", err)
8881
}
89-
fmt.Printf("### \n\n")
9082
}

0 commit comments

Comments
 (0)