Documentation
¶
Overview ¶
Package xerrors provides helper functions and types for error handling.
Example ¶
package main
import (
"fmt"
"os"
"git.sr.ht/~jamesponddotco/xstd-go/xerrors"
)
func main() {
const errOpenFile xerrors.Error = "failed to open file"
if _, err := os.Open("file-does-not-exist.txt"); err != nil {
fmt.Println(fmt.Errorf("%w: %w", errOpenFile, err))
}
}
Output: failed to open file: open file-does-not-exist.txt: no such file or directory
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.