panicdetector

package
v0.4.186 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Indices

func Indices(stack pruntime.Stack) (isPanic bool, recoveryIndex, panicIndex int)

Indices examines a stack to see if it includes a panic. Thread-safe

  • isPanic is true if the stack includes a panic
  • stack[recoveryIndex] is the code line of the deferred function containing recovery() invocation
  • stack[panicIndex] is the code line causing the panic located in the function deferring or any code that function invokes
  • for panic detection to work, the code line of defer() invocation must be included in stack
  • note: the location in the deferring function is returned as the last line of the deferring function
  • pruntime.Stack is the parsed output of runtime.Stack

func PanicDetectorValues

func PanicDetectorValues() (deferS, panicS string)

PanicDetectorValues is used by [whynotpanic.WhyNotPanic] to explain panic detection

Types

This section is empty.

Jump to

Keyboard shortcuts

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