add tracing logs in server side and client side

This commit is contained in:
kevin
2020-09-22 17:34:39 +08:00
parent 797a90ae7d
commit be9c48da7f
13 changed files with 127 additions and 45 deletions

View File

@@ -109,6 +109,18 @@ func TestParseRequired(t *testing.T) {
assert.NotNil(t, err)
}
func TestParseOptions(t *testing.T) {
v := struct {
Position int8 `form:"pos,options=1|2"`
}{}
r, err := http.NewRequest(http.MethodGet, "http://hello.com/a?pos=4", nil)
assert.Nil(t, err)
err = Parse(r, &v)
assert.NotNil(t, err)
}
func BenchmarkParseRaw(b *testing.B) {
r, err := http.NewRequest(http.MethodGet, "http://hello.com/a?name=hello&age=18&percent=3.4", nil)
if err != nil {