Documentation
¶
Overview ¶
Package location contains utilities for obtaining the function, file and line number of various Go types and values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct {
// Func is the fully-qualified name of the function.
//
// The format of this string is not defined by this package and is subject
// to change.
Func string
// File is the name of the Go source file.
File string
// Line is the line number within the file, starting at 1.
Line int
}
Location describes a location within a code base.
Any of the fields may be zero-valued, indicating that piece of information is unknown.
func OfCall ¶
func OfCall() Location
OfCall returns the location where its caller was called itself.
func OfPanic ¶
func OfPanic() Location
OfPanic returns the location of the call to panic() that caused the stack to start unwinding.
It must be called within a deferred function and only if recover() returned a non-nil value. Otherwise the behavior of the function is undefined.
Click to show internal directories.
Click to hide internal directories.