Skip to content

Instantly share code, notes, and snippets.

@asdine
Created October 13, 2016 17:52
Show Gist options
  • Save asdine/4c28fb282a22038409e3f9c57b262458 to your computer and use it in GitHub Desktop.
Save asdine/4c28fb282a22038409e3f9c57b262458 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
)
// curl -X GET -k -v "http://127.0.0.1:1323/a/b/d/something" <-- OK
// curl -X GET -k -v "http://127.0.0.1:1323/a/b/p/something" <-- Not OK
func main() {
e := echo.New()
// any path will be enough to reproduce the problem
g := e.Group("")
routes := []string{
"a/b/:id/something",
"a/b/:id/other",
"a/b/path",
}
for _, r := range routes {
g.GET(r, func(c echo.Context) error {
return c.String(http.StatusOK, "OK")
})
}
err := e.Run(standard.New(":1323"))
if err != nil {
panic(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment