MCPcopy
hub / github.com/restic/restic / getPosition

Function getPosition

internal/debug/debug.go:129–140  ·  view source on GitHub ↗

taken from https://github.com/VividCortex/trace

()

Source from the content-addressed store, hash-verified

127
128// taken from https://github.com/VividCortex/trace
129func getPosition() (fn, dir, file string, line int) {
130 pc, file, line, ok := runtime.Caller(2)
131 if !ok {
132 return "", "", "", 0
133 }
134
135 dirname, filename := filepath.Base(filepath.Dir(file)), filepath.Base(file)
136
137 Func := runtime.FuncForPC(pc)
138
139 return path.Base(Func.Name()), dirname, filename, line
140}
141
142func checkFilter(filter map[string]bool, key string) bool {
143 // check if key is enabled directly

Callers 1

LogFunction · 0.85

Calls 3

BaseMethod · 0.65
DirMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected