internal

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TraverseErr added in v1.3.1

func TraverseErr(err error, fn func(error) (ok bool)) (ok bool)

TraverseErr traverses the err error chain until fn returns true. Traversal stops on nil errors, fn(nil) is never called. Returns true if fn matched, false otherwise.

Types

type Stack added in v1.6.0

type Stack []uintptr

Stack is a captured call stack. Program counters are captured eagerly so they reflect the call site, but resolving them into file names, function names, and line numbers is deferred until Traces because it is comparatively expensive and most errors never have their traces inspected.

func CaptureStack added in v1.6.0

func CaptureStack(skip int) Stack

CaptureStack captures the current call stack with some deep frames skipped.

func (Stack) Traces added in v1.6.0

func (s Stack) Traces() Traces

Traces resolves the captured stack.

type Trace

type Trace struct {
	// Path is a full file path
	Path string `json:"path"`
	// Func is a function name
	Func string `json:"func"`
	// Line is a code line number
	Line int `json:"line"`
}

Trace stores structured trace entry, including file line and path

func (*Trace) String

func (t *Trace) String() string

String returns debug-friendly representation of this trace

type Traces

type Traces []Trace

Traces is a list of trace entries

func CaptureTraces

func CaptureTraces(skip int) Traces

CaptureTraces gets the current stack trace with some deep frames skipped

func (Traces) Func

func (s Traces) Func() string

Func returns first function in trace list

func (Traces) FuncName

func (s Traces) FuncName() string

Func returns just function name

func (Traces) Loc

func (s Traces) Loc() string

Loc points to file/line location in the code

func (Traces) String

func (s Traces) String() string

String returns debug-friendly representaton of trace stack

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL