From e01ca4e2fc7930d5a6585400e202cb33aaed163f Mon Sep 17 00:00:00 2001 From: ksw2000 <13825170+ksw2000@users.noreply.github.com> Date: Tue, 25 Mar 2025 17:05:03 +0000 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8FRefactor:=20rename=20getMetho?= =?UTF-8?q?dINT=20to=20getMethodInt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctx.go | 2 +- ctx_interface.go | 2 +- ctx_interface_gen.go | 2 +- helpers.go | 4 ++-- router.go | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ctx.go b/ctx.go index dd55ad97..1816185e 100644 --- a/ctx.go +++ b/ctx.go @@ -1947,7 +1947,7 @@ func (c *DefaultCtx) getBody() []byte { } // Methods to use with next stack. -func (c *DefaultCtx) getMethodINT() int { +func (c *DefaultCtx) getMethodInt() int { return c.methodInt } diff --git a/ctx_interface.go b/ctx_interface.go index 6ef33847..c2eb8bf4 100644 --- a/ctx_interface.go +++ b/ctx_interface.go @@ -17,7 +17,7 @@ type CustomCtx interface { Reset(fctx *fasthttp.RequestCtx) // Methods to use with next stack. - getMethodINT() int + getMethodInt() int getIndexRoute() int getTreePathHash() int getDetectionPath() string diff --git a/ctx_interface_gen.go b/ctx_interface_gen.go index a4d7db3d..df537e26 100644 --- a/ctx_interface_gen.go +++ b/ctx_interface_gen.go @@ -345,7 +345,7 @@ type Ctx interface { release() getBody() []byte // Methods to use with next stack. - getMethodINT() int + getMethodInt() int getIndexRoute() int getTreePathHash() int getDetectionPath() string diff --git a/helpers.go b/helpers.go index bbaa1805..573aab3d 100644 --- a/helpers.go +++ b/helpers.go @@ -108,7 +108,7 @@ func (app *App) methodExist(c *DefaultCtx) bool { methods := app.config.RequestMethods for i := 0; i < len(methods); i++ { // Skip original method - if c.getMethodINT() == i { + if c.getMethodInt() == i { continue } // Reset stack index @@ -152,7 +152,7 @@ func (app *App) methodExistCustom(c CustomCtx) bool { methods := app.config.RequestMethods for i := 0; i < len(methods); i++ { // Skip original method - if c.getMethodINT() == i { + if c.getMethodInt() == i { continue } // Reset stack index diff --git a/router.go b/router.go index 0fc9b455..ac5832bc 100644 --- a/router.go +++ b/router.go @@ -110,9 +110,9 @@ func (r *Route) match(detectionPath, path string, params *[maxParams]string) boo func (app *App) nextCustom(c CustomCtx) (bool, error) { //nolint:unparam // bool param might be useful for testing // Get stack length - tree, ok := app.treeStack[c.getMethodINT()][c.getTreePathHash()] + tree, ok := app.treeStack[c.getMethodInt()][c.getTreePathHash()] if !ok { - tree = app.treeStack[c.getMethodINT()][0] + tree = app.treeStack[c.getMethodInt()][0] } lenr := len(tree) - 1