diff options
| author | Christine Dodrill <me@christine.website> | 2018-11-13 07:30:55 -0800 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2018-11-13 07:30:55 -0800 |
| commit | e245d89daa6dffc441be07dcb81b985397446378 (patch) | |
| tree | 0d399b0de689f43fbbfaa979d939dca8aa03e716 /vendor/github.com/Xe/ln/stack.go | |
| parent | bc8b7e5471e7f4984ee69af07d8e9632df01b85b (diff) | |
| parent | 8fe5504c3a5e9cd8409d5296d128603a231567ac (diff) | |
| download | xesite-e245d89daa6dffc441be07dcb81b985397446378.tar.xz xesite-e245d89daa6dffc441be07dcb81b985397446378.zip | |
Merge branch 'master' of git@github.com:Xe/site.git
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)] -} |
