From e001721edfcfc3d58364ce131ef4b0d4c12f7bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F=E4=B9=90?= Date: Wed, 18 Oct 2023 09:47:38 +0800 Subject: [PATCH] auto commit --- transport/http/binding/bind.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/transport/http/binding/bind.go b/transport/http/binding/bind.go index 6413e13..796f442 100644 --- a/transport/http/binding/bind.go +++ b/transport/http/binding/bind.go @@ -3,13 +3,14 @@ package binding import ( "git.diulo.com/mogfee/kit/encoding" "git.diulo.com/mogfee/kit/encoding/form" + "git.diulo.com/mogfee/kit/errors" "net/http" "net/url" ) func BindQuery(vars url.Values, target any) error { if err := encoding.GetCodec(form.Name).Unmarshal([]byte(vars.Encode()), target); err != nil { - return errorx.BadRequest("CODEC", err.Error()) + return errors.BadRequest("CODEC", err.Error()) } return nil } @@ -18,7 +19,7 @@ func BindForm(req *http.Request, target any) error { return err } if err := encoding.GetCodec(form.Name).Unmarshal([]byte(req.Form.Encode()), target); err != nil { - return errorx.BadRequest("CODEC", err.Error()) + return errors.BadRequest("CODEC", err.Error()) } return nil }