Skip to content

Commit 99aaf5d

Browse files
committed
flag pkg support documentation
1 parent 4ae12a4 commit 99aaf5d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

assert/doc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ error messages and diagnostic they need.
5252
5353
Please see the code examples for more information.
5454
55+
# Flag Package Support
56+
57+
The assert package supports Go's flags. All you need to do is to call flag.Parse.
58+
And the following flags are supported (="default-value"):
59+
-asserter="Prod"
60+
A name of the asserter Plain, Prod, Dev, Debug (see constants)
61+
62+
And assert package's configuration flags are inserted.
63+
5564
Note. assert.That's performance is equal to the if-statement. Most of the
5665
generics-based versions are almost as fast. If your algorithm is
5766
performance-critical please run `make bench` in the err2 repo and decide case by

doc.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,17 @@ tracer API:
8989
9090
err2.SetLogTracer(nil) // the default is nil where std log pkg is used.
9191
92+
# Flag Package Support
93+
94+
The err2 package supports Go's flags. All you need to do is to call flag.Parse.
95+
And the following flags are supported (="default-value"):
96+
-err2-log="nil"
97+
A name of the stream currently supported stderr, stdout or nil
98+
-err2-panic-trace="stderr"
99+
A name of the stream currently supported stderr, stdout or nil
100+
-err2-trace="nil"
101+
A name of the stream currently supported stderr, stdout or nil
102+
92103
# Error handling
93104
94105
Package err2 relies on declarative control structures to achieve error and panic

0 commit comments

Comments
 (0)