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 OfFunc ¶
func OfFunc(fn interface{}) Location
OfFunc returns the location of the definition of fn.
Click to show internal directories.
Click to hide internal directories.