Documentation
¶
Index ¶
- Variables
- func FindGoModDir(in string) string
- func FindGoModDirLinks(in string) string
- func IgnorePackage(skip ...int) bool
- func Init()
- func IsIgnoredPackage(pkg string) (ok bool)
- func Reset()
- func SplitPackageFunc(fn string) (string, string)
- func UnignorePackage(skip ...int) bool
- type Frames
- type Level
- type Stack
Constants ¶
This section is empty.
Variables ¶
var CallersFrames = func(callers []uintptr) Frames { return runtime.CallersFrames(callers) }
CallersFrames is only intended to be used in go-testdeep internal tests to cover all cases.
Functions ¶
func FindGoModDir ¶
FindGoModDir finds the closest directory containing go.mod file starting from directory in.
func FindGoModDirLinks ¶
FindGoModDirLinks finds the closest directory containing go.mod file starting from directory in after cleaning it. If not found, expands symlinks and re-searches.
func IgnorePackage ¶
IgnorePackage records the calling package as ignored one in trace.
func IsIgnoredPackage ¶
IsIgnoredPackage returns true if pkg is ignored, false otherwise. Only intended to be used in go-testdeep internal tests.
func Reset ¶
func Reset()
Reset resets the ignored packages map plus cached mod and GOPATH directories (Init should be called again). Only intended to be used in go-testdeep internal tests.
func SplitPackageFunc ¶
SplitPackageFunc splits a fully qualified function name into its package and function parts:
"foo/bar/test.fn" → "foo/bar/test", "fn" "foo/bar/test.X.fn" → "foo/bar/test", "X.fn" "foo/bar/test.(*X).fn" → "foo/bar/test", "(*X).fn" "foo/bar/test.(*X).fn.func1" → "foo/bar/test", "(*X).fn.func1" "weird" → "", "weird"
func UnignorePackage ¶
UnignorePackage cancels a previous use of IgnorePackage, so the calling package is no longer ignored. Only intended to be used in go-testdeep internal tests.
Types ¶
type Frames ¶
Frames is the interface corresponding to type returned by runtime.CallersFrames. See CallersFrames variable.
type Stack ¶ added in v1.9.1
type Stack []Level
Stack is a simple stack trace.
func (Stack) IsRelevant ¶ added in v1.11.0
IsRelevant returns true if the stack contains more than one level, or if the single level has a path with at least one directory.