MCPcopy
hub / github.com/gin-gonic/gin / HandlerName

Method HandlerName

context.go:149–151  ·  view source on GitHub ↗

HandlerName returns the main handler's name. For example if the handler is "handleGetUsers()", this function will return "main.handleGetUsers".

()

Source from the content-addressed store, hash-verified

147// HandlerName returns the main handler's name. For example if the handler is "handleGetUsers()",
148// this function will return "main.handleGetUsers".
149func (c *Context) HandlerName() string {
150 return nameOfFunction(c.handlers.Last())
151}
152
153// HandlerNames returns a list of all registered handlers for this context in descending order,
154// following the semantics of HandlerName()

Callers 1

TestContextHandlerNameFunction · 0.80

Calls 2

nameOfFunctionFunction · 0.85
LastMethod · 0.45

Tested by 1

TestContextHandlerNameFunction · 0.64