()
| 104 | } |
| 105 | |
| 106 | func trace() string { |
| 107 | if pc, file, line, ok := runtime.Caller(2); ok { |
| 108 | filename := path.Base(file) |
| 109 | pkgAndFuncName := path.Base(runtime.FuncForPC(pc).Name()) |
| 110 | return fmt.Sprintf("%s (%s:%d)", pkgAndFuncName, filename, line) |
| 111 | } |
| 112 | return "" |
| 113 | } |
| 114 | |
| 115 | // ErrorCtxKey is the context key to use when storing |
| 116 | // an error (for use with context.Context). |