diff options
| author | Christine Dodrill <me@christine.website> | 2018-10-19 06:58:02 -0700 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2018-10-19 06:58:35 -0700 |
| commit | d2ff4407993e4511e0225c12964bc07cd8d02be6 (patch) | |
| tree | 1ca621c635b568054bf8808306cf4b6baa9cfedf /vendor/github.com/Xe/ln/stack.go | |
| parent | f363c7e7eb6ca43e92624365ceab66a78d99b376 (diff) | |
| download | xesite-d2ff4407993e4511e0225c12964bc07cd8d02be6.tar.xz xesite-d2ff4407993e4511e0225c12964bc07cd8d02be6.zip | |
use GOPROXY
Diffstat (limited to 'vendor/github.com/Xe/ln/stack.go')
| -rw-r--r-- | vendor/github.com/Xe/ln/stack.go | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/vendor/github.com/Xe/ln/stack.go b/vendor/github.com/Xe/ln/stack.go deleted file mode 100644 index 1cf1e7a..0000000 --- a/vendor/github.com/Xe/ln/stack.go +++ /dev/null @@ -1,44 +0,0 @@ -package ln - -import ( - "os" - "runtime" - "strings" -) - -type frame struct { - filename string - function string - lineno int -} - -// skips 2 frames, since Caller returns the current frame, and we need -// the caller's caller. -func callersFrame() frame { - var out frame - pc, file, line, ok := runtime.Caller(3) - if !ok { - return out - } - srcLoc := strings.LastIndex(file, "/src/") - if srcLoc >= 0 { - file = file[srcLoc+5:] - } - out.filename = file - out.function = functionName(pc) - out.lineno = line - - return out -} - -func functionName(pc uintptr) string { - fn := runtime.FuncForPC(pc) - if fn == nil { - return "???" - } - name := fn.Name() - beg := strings.LastIndex(name, string(os.PathSeparator)) - return name[beg+1:] - // end := strings.LastIndex(name, string(os.PathSeparator)) - // return name[end+1 : len(name)] -} |
