Close file after os.Open()

This commit is contained in:
FengyunPan
2017-05-22 21:51:11 +08:00
parent 5dd56c9b1e
commit 287f703d3a
3 changed files with 3 additions and 0 deletions

View File

@@ -2013,6 +2013,7 @@ func newStreamingUpload(filePath string) (*io.PipeReader, *multipart.Writer, err
if err != nil {
return nil, nil, err
}
defer file.Close()
r, w := io.Pipe()