chore: fix lint errors (#2520)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -10,14 +11,14 @@ import (
|
||||
)
|
||||
|
||||
func TestNewRequestParserNoVar(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "/", nil)
|
||||
req := httptest.NewRequest("GET", "/", http.NoBody)
|
||||
parser, err := NewRequestParser(req, nil)
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, parser)
|
||||
}
|
||||
|
||||
func TestNewRequestParserWithVars(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "/", nil)
|
||||
req := httptest.NewRequest("GET", "/", http.NoBody)
|
||||
req = pathvar.WithVars(req, map[string]string{"a": "b"})
|
||||
parser, err := NewRequestParser(req, nil)
|
||||
assert.Nil(t, err)
|
||||
@@ -48,14 +49,14 @@ func TestNewRequestParserWithVarsWithWrongBody(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewRequestParserWithForm(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "/val?a=b", nil)
|
||||
req := httptest.NewRequest("GET", "/val?a=b", http.NoBody)
|
||||
parser, err := NewRequestParser(req, nil)
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, parser)
|
||||
}
|
||||
|
||||
func TestNewRequestParserWithBadForm(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "/val?a%1=b", nil)
|
||||
req := httptest.NewRequest("GET", "/val?a%1=b", http.NoBody)
|
||||
parser, err := NewRequestParser(req, nil)
|
||||
assert.NotNil(t, err)
|
||||
assert.Nil(t, parser)
|
||||
|
||||
Reference in New Issue
Block a user