HandlerFileLineRel same as `HandlerFileLine` but it returns the path corresponding to its relative based on the package-level "WorkingDir" variable.
(h interface{})
| 196 | // HandlerFileLineRel same as `HandlerFileLine` but it returns the path |
| 197 | // corresponding to its relative based on the package-level "WorkingDir" variable. |
| 198 | func HandlerFileLineRel(h interface{}) (file string, line int) { |
| 199 | file, line = HandlerFileLine(h) |
| 200 | if relFile, err := filepath.Rel(WorkingDir, file); err == nil { |
| 201 | if !strings.HasPrefix(relFile, "..") { |
| 202 | // Only if it's relative to this path, not parent. |
| 203 | file = "./" + relFile |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | return |
| 208 | } |
| 209 | |
| 210 | // MainHandlerName tries to find the main handler that end-developer |
| 211 | // registered on the provided chain of handlers and returns its function name. |
no test coverage detected
searching dependent graphs…