golangci(lint) : more linters (#2870)

This commit is contained in:
Matthieu MOREL
2021-09-21 09:22:21 +02:00
committed by GitHub
parent 3a6f18f32f
commit 71f7087097
7 changed files with 24 additions and 8 deletions

View File

@ -220,7 +220,8 @@ func (c *Context) Error(err error) *Error {
panic("err is nil")
}
parsedError, ok := err.(*Error)
var parsedError *Error
ok := errors.As(err, &parsedError)
if !ok {
parsedError = &Error{
Err: err,
@ -515,7 +516,7 @@ func (c *Context) initFormCache() {
c.formCache = make(url.Values)
req := c.Request
if err := req.ParseMultipartForm(c.engine.MaxMultipartMemory); err != nil {
if err != http.ErrNotMultipart {
if !errors.Is(err, http.ErrNotMultipart) {
debugPrint("error on parse multipart form array: %v", err)
}
}