Skip to content

Commit c9da721

Browse files
committed
sample how to use init() with flag defaults for err2
1 parent 67cff84 commit c9da721

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ var (
1515

1616
func init() {
1717
// highlight that this is before flag.Parse to allow it to work properly.
18-
err2.SetLogTracer(os.Stderr)
18+
err2.SetLogTracer(os.Stderr) // for import
19+
err2.SetLogTracer(nil)
1920
}
2021

2122
func main() {

0 commit comments

Comments
 (0)