Skip to content

Commit 474ff2c

Browse files
committed
start hyperlinks for docs
1 parent 089db87 commit 474ff2c

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

err2.go

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
)
99

1010
type (
11-
// Handler is a function type used to process error values in Handle and
12-
// Catch. We currently have a few build-ins of the Handler: err2.Noop,
13-
// err2.Reset, etc.
11+
// Handler is a function type used to process error values in [Handle] and
12+
// [Catch]. We currently have a few build-ins of the Handler: [Noop],
13+
// [Reset], etc.
1414
Handler = handler.ErrorFn
1515
)
1616

@@ -34,8 +34,8 @@ var (
3434
ErrRecoverable = errors.New("recoverable")
3535

3636
// Stdnull implements io.Writer that writes nothing, e.g.,
37-
// err2.SetLogTracer in cases you don't want to use automatic log writer,
38-
// i.e., LogTracer == /dev/null. It can be used to change how the Catch
37+
// [SetLogTracer] in cases you don't want to use automatic log writer,
38+
// i.e., [LogTracer] == /dev/null. It can be used to change how the Catch
3939
// works, e.g., in CLI apps.
4040
Stdnull = &nullDev{}
4141
)
@@ -66,7 +66,7 @@ var (
6666
// defer err2.Handle(&err, nil) // nil arg disable automatic annotation.
6767
//
6868
// In case of the actual error handling, the handler function should be given as
69-
// an second argument:
69+
// a second argument:
7070
//
7171
// defer err2.Handle(&err, func(err error) error {
7272
// if rmErr := os.Remove(dst); rmErr != nil {
@@ -77,7 +77,7 @@ var (
7777
//
7878
// You can have unlimited amount of error handlers. They are called if error
7979
// happens and they are called in the same order as they are given or until one
80-
// of them resets the error like Reset (notice the other predefined error
80+
// of them resets the error like [Reset] (notice the other predefined error
8181
// handlers) in the next samples:
8282
//
8383
// defer err2.Handle(&err, err2.Reset, err2.Log) // Log not called
@@ -118,9 +118,10 @@ func Handle(err *error, a ...any) {
118118
// the defer.
119119
//
120120
// The deferred Catch is very convenient, because it makes your current
121-
// goroutine panic and error-safe, one line only! You can fine tune its
122-
// behavior with functions like err2.SetErrorTrace, assert.SetDefault, and
123-
// logging settings. Start with the defaults and simplest version of Catch:
121+
// goroutine panic and error-safe. You can fine tune its 'global' behavior with
122+
// functions like [SetErrorTracer], [SetPanicTracer], and [SetLogTracer]. Its
123+
// 'local' behavior depends the arguments you give it. Let's start with the
124+
// defaults and simplest version of Catch:
124125
//
125126
// defer err2.Catch()
126127
//
@@ -139,9 +140,9 @@ func Handle(err *error, a ...any) {
139140
//
140141
// The next one stops errors and panics, but allows you handle errors, like
141142
// cleanups, etc. The error handler function has same signature as Handle's
142-
// error handling function, i.e., err2.Handler. By returning nil resets the
143+
// error handling function [Handler]. By returning nil resets the
143144
// error, which allows e.g. prevent automatic error logs to happening.
144-
// Otherwise, the output results depends on the current Tracer and assert
145+
// Otherwise, the output results depends on the current [Tracer] and assert
145146
// settings. The default trace setting prints call stacks for panics but not for
146147
// errors:
147148
//

0 commit comments

Comments
 (0)