Documentation
¶
Overview ¶
Package errorutil provides functions to work with errors.
Index ¶
Constants ¶
const ( FilterTraceExclude = 0 // Exclude the paths that match. FilterTraceInclude = 1 // Include only the paths that match. )
Modes for FilterPatterns.
Variables ¶
This section is empty.
Functions ¶
func FilterTrace ¶
FilterTrace removes unneeded stack traces from an error.
Types ¶
type Patterns ¶
type Patterns struct {
// contains filtered or unexported fields
}
Patterns for filtering error traces.
func FilterPattern ¶
FilterPattern compiles filter patterns for FilterTrace()
Frames are filtered according to the mode; with FilterTraceExclude all frames are included except those that match the given patterns. With FilterTraceInclude all frames are excluded except those that match one of the patterns.
Paths starting with re: are treated as a regular expression.
Paths starting with match: are matched with filepath.Match()
Paths ending with .go are matches against the full file path (i.e. /home/martin/go/src/.../file.go).
Anything else is matches against the package path (i.e. github.com/foo/bar).