2

I'm using groups in Echo to pack some routes with a common prefix but when I get the list of routes, it returns routes for all HTTP methods.

main.go

e := echo.New()
adminGroup := e.Group("/admin")
adminGroup.GET("/", adminIndex)

I use this to get list of routes:

e.Routes()

Output

...
   {
      "method": "TRACE",
      "path": "/admin/*",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "PATCH",
      "path": "/admin",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "PROPFIND",
      "path": "/admin",
      "name": "github.com/labstack/echo/v4.glob..func1"
   },
   {
      "method": "GET",
      "path": "/admin/*",
      "name": "github.com/labstack/echo/v4.glob..func1"
   }
...

I expect to get route just to GET admin/

0 Answers0