MCPcopy Create free account
hub / github.com/kataras/iris / HandlerFileLineRel

Function HandlerFileLineRel

context/handler.go:198–208  ·  view source on GitHub ↗

HandlerFileLineRel same as `HandlerFileLine` but it returns the path corresponding to its relative based on the package-level "WorkingDir" variable.

(h interface{})

Source from the content-addressed store, hash-verified

196// HandlerFileLineRel same as `HandlerFileLine` but it returns the path
197// corresponding to its relative based on the package-level "WorkingDir" variable.
198func 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.

Callers 4

getSourceFileLineFunction · 0.92
createRoutesMethod · 0.92
fixRouteInfoFunction · 0.92
TraceMethod · 0.92

Calls 1

HandlerFileLineFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…