debug

package
v1.11.2-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: Apache-2.0 Imports: 9 Imported by: 27

Documentation

Overview

Package debug provides a very simple function that, if executed will replace the executable with dlv running the executable and listening on the port specified by an environment variable.

Example:
if err := debug.Self(); err != nil {
   fmt.Println(err)
}

Index

Constants

View Source
const (
	// Dlv - name of Dlv executable, also used as default prefix to env variable, ie, DLV_
	Dlv = "dlv"
	// Listen - string used as default second part of env variable, ie, _PORT in DLV_PORT
	Listen = "listen"
)

Variables

This section is empty.

Functions

func Self

func Self(envVariableParts ...string) error

Self - replaces executable with dlv running the executable and listening on a port

envVariableParts - variadic list of 'pieces' to be transformed into the
                   env variable indicating where dlv should listen.
                   Default: If no envVariableParts are provided, env variable
                            defaults to []string{Dlv,Listen,path.Base(os.Args[0])}
                            which is DLV_PORT_<name of executable>

Types

This section is empty.

Jump to

Keyboard shortcuts

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