From cc98043affbf5144f46886142addfa9227345bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 22 Jul 2024 11:19:41 +0800 Subject: [PATCH] update Test --- go.mod | 4 ---- go.sum | 2 -- router/register.go | 6 ++---- router/register_test.go | 4 +++- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 3f808f8..f62b322 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,6 @@ require ( git.zhangdeman.cn/zhangdeman/wrapper v0.0.0-20240627031706-9ff1c213bb50 github.com/gin-gonic/gin v1.10.0 github.com/go-playground/validator/v10 v10.22.0 - github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 ) @@ -27,7 +25,6 @@ require ( github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/cloudwego/base64x v0.1.4 // indirect github.com/cloudwego/iasm v0.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // indirect github.com/gabriel-vasile/mimetype v1.4.4 // indirect github.com/gin-contrib/sse v0.1.0 // indirect @@ -45,7 +42,6 @@ require ( github.com/mozillazg/go-pinyin v0.20.0 // indirect github.com/mssola/user_agent v0.6.0 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/tidwall/gjson v1.17.1 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/go.sum b/go.sum index 0a7c671..6ca8741 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,6 @@ github.com/mssola/user_agent v0.6.0 h1:uwPR4rtWlCHRFyyP9u2KOV0u8iQXmS7Z7feTrstQw github.com/mssola/user_agent v0.6.0/go.mod h1:TTPno8LPY3wAIEKRpAtkdMT0f8SE24pLRGPahjCH4uw= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= diff --git a/router/register.go b/router/register.go index aaf2fc9..aec336c 100644 --- a/router/register.go +++ b/router/register.go @@ -13,13 +13,11 @@ import ( "git.zhangdeman.cn/zhangdeman/gin/middleware" "git.zhangdeman.cn/zhangdeman/gin/request" "git.zhangdeman.cn/zhangdeman/gin/response" + "git.zhangdeman.cn/zhangdeman/wrapper" + "github.com/gin-gonic/gin" "net/http" "reflect" "strings" - - "git.zhangdeman.cn/zhangdeman/wrapper" - - "github.com/gin-gonic/gin" ) var ( diff --git a/router/register_test.go b/router/register_test.go index 838898c..b021fe5 100644 --- a/router/register_test.go +++ b/router/register_test.go @@ -34,7 +34,9 @@ type TestForm struct { Meta `tag:"测试表单" path:"/a/b/c/d" desc:"测试接口" method:"get" strict:"true"` Age int `json:"age" form:"age"` Name string `json:"name" form:"name"` - Test any `json:"test" form:"test"` + Test struct { + L string `json:"l"` + } `json:"test" form:"test"` } func Test_parseController(t *testing.T) {