1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-01 00:55:04 +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

@ -93,7 +93,6 @@ func (responseWriterErr) WriteHeader(statusCode int) {
func TestContext(t *testing.T) {
e := New()
*e.maxParam = 1
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(userJSON))
rec := httptest.NewRecorder()
c := e.NewContext(req, rec).(*context)
@ -472,7 +471,6 @@ func TestContextPath(t *testing.T) {
func TestContextPathParam(t *testing.T) {
e := New()
*e.maxParam = 2
req := httptest.NewRequest(http.MethodGet, "/", nil)
c := e.NewContext(req, nil)
@ -491,7 +489,8 @@ func TestContextPathParam(t *testing.T) {
func TestContextGetAndSetParam(t *testing.T) {
e := New()
*e.maxParam = 2
r := e.Router()
r.Add(http.MethodGet, "/:foo", func(Context) error { return nil })
req := httptest.NewRequest(http.MethodGet, "/:foo", nil)
c := e.NewContext(req, nil)
c.SetParamNames("foo")