trace

package
v2.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Provide utility to get stack trace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	// contains filtered or unexported fields
}

Single location of the trace

func FilterByPkgs added in v2.0.11

func FilterByPkgs(locations []Location, pkgs ...string) []Location

Filter the locations slice by pkg prefix

func Get

func Get(skip, deep int) (locations []Location)

Get return list of location of stack trace for calling function.

skip tell Get to skip some trace, 0 is where Get is called. deep tell Get how deep the stack trace is.

func (*Location) File

func (l *Location) File() string

The file path that this Location point to

func (*Location) Func

func (l *Location) Func() string

The path-qualified function that this location point to

func (*Location) InPkg added in v2.0.11

func (l *Location) InPkg(pkgs ...string) bool

return true if this location is in package pkgs

func (*Location) Line

func (l *Location) Line() int

The line that this Location point to

func (*Location) String

func (l *Location) String() string

String representation of Location

Jump to

Keyboard shortcuts

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