7
7
"github.com/lainio/err2/internal/handler"
8
8
)
9
9
10
- // Stderr is a built-in helper to use with Handle and Catch. It prints the
10
+ // Stderr is a built-in helper to use with [ Handle] and [ Catch] . It prints the
11
11
// error to stderr and it resets the current error value. It's a handy Catch
12
12
// handler in main function.
13
13
//
@@ -51,10 +51,10 @@ func Noop(err error) error { return err }
51
51
// defer err2.Handle(&err, err2.Reset)
52
52
func Reset (error ) error { return nil }
53
53
54
- // Err is a built-in helper to use with Handle and Catch. It offers simplifier
54
+ // Err is a built-in helper to use with [ Handle] and [ Catch] . It offers simplifier
55
55
// for error handling function for cases where you don't need to change the
56
56
// current error value. For instance, if you want to just write error to stdout,
57
- // and don't want to use SetLogTracer and keep it to write to your logs.
57
+ // and don't want to use [ SetLogTracer] and keep it to write to your logs.
58
58
//
59
59
// defer err2.Catch(err2.Err(func(err error) {
60
60
// fmt.Println("ERROR:", err)
@@ -73,7 +73,7 @@ func Err(f func(err error)) Handler {
73
73
74
74
const lvl = 10
75
75
76
- // Log prints error string to the current log that is set by SetLogTracer.
76
+ // Log prints error string to the current log that is set by [ SetLogTracer] .
77
77
func Log (err error ) error {
78
78
if err == nil {
79
79
return nil
@@ -82,7 +82,7 @@ func Log(err error) error {
82
82
return err
83
83
}
84
84
85
- // StderrNoReset is a built-in helper to use with Handle and Catch. It prints
85
+ // StderrNoReset is a built-in helper to use with [ Handle] and [ Catch] . It prints
86
86
// the error to stderr. If you need to reset err value use Stderr instead.
87
87
//
88
88
// You can use it like this:
@@ -97,7 +97,7 @@ func StderrNoReset(err error) error {
97
97
return err
98
98
}
99
99
100
- // StdoutNoReset is a built-in helper to use with Handle and Catch. It prints
100
+ // StdoutNoReset is a built-in helper to use with [ Handle] and [ Catch] . It prints
101
101
// the error to stdout.
102
102
//
103
103
// You can use it like this:
0 commit comments