Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallResolver ¶
type CallResolver struct {
// contains filtered or unexported fields
}
A CallResolver is a helping hand around runtime.Caller() to look up file, line and name of the calling function. CallResolver caches the results of its lookups and strips the uninteresting prefix from both the caller's location and name; see NewCallResolver().
func NewCallResolver ¶
func NewCallResolver(re *regexp.Regexp) *CallResolver
NewCallResolver returns a CallResolver. The supplied pattern must specify a valid regular expression and is used to format the paths returned by Lookup(): If submatches are specified, their concatenation forms the path, otherwise the match of the whole expression is used. Paths which do not match at all are left unchanged. TODO(bdarnell): don't strip paths at lookup time, but at display time; need better handling for callers such as x/tools/something.