diff options
author | Wolfy-J <[email protected]> | 2018-09-29 23:25:04 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-09-29 23:25:04 +0300 |
commit | 06936766844c9d0d4f1f9f92efb622ba765c8c64 (patch) | |
tree | 456f679f57be64ee3963e823182f894668f28911 /service | |
parent | 1cfb3a4d142db6afec2befe82bdfdf625cc0f2d4 (diff) |
removed empty error check
Diffstat (limited to 'service')
-rw-r--r-- | service/http/handler.go | 5 | ||||
-rw-r--r-- | service/http/request.go | 6 | ||||
-rw-r--r-- | service/http/uploads.go | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/service/http/handler.go b/service/http/handler.go index 945cd51e..f719c751 100644 --- a/service/http/handler.go +++ b/service/http/handler.go @@ -72,10 +72,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - if err = req.Open(); err != nil { - h.handleError(w, r, err) - return - } + req.Open() defer req.Close() p, err := req.Payload() diff --git a/service/http/request.go b/service/http/request.go index d733b20c..eb5c05bd 100644 --- a/service/http/request.go +++ b/service/http/request.go @@ -109,12 +109,12 @@ func NewRequest(r *http.Request, cfg *UploadsConfig) (req *Request, err error) { } // Open moves all uploaded files to temporary directory so it can be given to php later. -func (r *Request) Open() error { +func (r *Request) Open() { if r.Uploads == nil { - return nil + return } - return r.Uploads.Open() + r.Uploads.Open() } // Close clears all temp file uploads diff --git a/service/http/uploads.go b/service/http/uploads.go index 9b205f00..7610ab28 100644 --- a/service/http/uploads.go +++ b/service/http/uploads.go @@ -45,7 +45,7 @@ func (u *Uploads) MarshalJSON() ([]byte, error) { // Open moves all uploaded files to temp directory, return error in case of issue with temp directory. File errors // will be handled individually. -func (u *Uploads) Open() error { +func (u *Uploads) Open() { var wg sync.WaitGroup for _, f := range u.list { wg.Add(1) @@ -56,7 +56,6 @@ func (u *Uploads) Open() error { } wg.Wait() - return nil } // Clear deletes all temporary files. |