1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-03 00:56:59 +02:00

Set maxParam with SetParamNames (#1535)

* Set maxParam with SetParamNames

Fixes #1492

* Revert go.mod
This commit is contained in:
178inaba
2020-03-31 04:28:07 +09:00
committed by GitHub
parent 542835808e
commit 269dfcc9dd
4 changed files with 4 additions and 11 deletions

View File

@ -310,6 +310,7 @@ func (c *context) ParamNames() []string {
func (c *context) SetParamNames(names ...string) {
c.pnames = names
*c.echo.maxParam = len(names)
}
func (c *context) ParamValues() []string {
@ -317,10 +318,7 @@ func (c *context) ParamValues() []string {
}
func (c *context) SetParamValues(values ...string) {
// NOTE: Don't just set c.pvalues = values, because it has to have length c.echo.maxParam at all times
for i, val := range values {
c.pvalues[i] = val
}
c.pvalues = values
}
func (c *context) QueryParam(name string) string {