runtime

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithOSSignalCancellation

func ContextWithOSSignalCancellation() context.Context

ContextWithOSSignalCancellation builds a new Context that cancels itself on os.Interrupt signals.

Types

type StackFrame

type StackFrame struct {
	// The path to the file containing this ProgramCounter
	File string
	// The LineNumber in that file
	LineNumber int
	// The Name of the function that contains this ProgramCounter
	Name string
	// The Package that contains this function
	Package string
	// The underlying ProgramCounter
	ProgramCounter uintptr
}

A StackFrame contains all necessary information about to generate a line in a call stack.

func Caller added in v1.1.0

func Caller() *StackFrame

Caller returns the frame of the calling function.

func Stack

func Stack() []*StackFrame

Stack produces a stack trace for the current caller.

func (*StackFrame) Func

func (f *StackFrame) Func() *runtime.Func

Func returns the function that contained this frame.

func (*StackFrame) String added in v1.1.0

func (f *StackFrame) String() string

String is the string representation of a StackFrame.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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