From f8bd8a24504b2eba51caca33389f5849eb7aad5f Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Thu, 20 Jun 2024 12:40:02 +0800 Subject: [PATCH] feat: export ErrMissingFile * closes #1138 This follows the std library approach: https://pkg.go.dev/net/http#ErrMissingFile --- pkg/protocol/request.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/protocol/request.go b/pkg/protocol/request.go index d04731867..8e4b40bf7 100644 --- a/pkg/protocol/request.go +++ b/pkg/protocol/request.go @@ -65,7 +65,7 @@ import ( ) var ( - errMissingFile = errors.NewPublic("http: no such file") + ErrMissingFile = errors.NewPublic("http: no such file") responseBodyPool bytebufferpool.Pool requestBodyPool bytebufferpool.Pool @@ -313,7 +313,7 @@ func (req *Request) FormFile(name string) (*multipart.FileHeader, error) { } fhh := mf.File[name] if fhh == nil { - return nil, errMissingFile + return nil, ErrMissingFile } return fhh[0], nil }