debug

package
v3.16.6 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ThisCaller

func ThisCaller() string

ThisCaller returns a string identifying the function that invoked the function where ThisCaller was invoked. The return value is ${package}/${file}:${linenumber}. For example: Suppose we have file: mygomod/pkg/parent.go

func parent() {
  child()
}

file: mygomod/pkg/child.go

func child() {
 c := debug.ThisCaller()
}

The return value of ThisCaller will be "pkg/parent.go:2" Returning the full path wouldn't be useful because it would be the full path on the machine where the code was compiled

Types

This section is empty.

Jump to

Keyboard shortcuts

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