Skip to content

Commit

Permalink
Fix unchecked error in filestream writeFile()
Browse files Browse the repository at this point in the history
  • Loading branch information
omerzi committed Mar 13, 2024
1 parent 13ecbc3 commit 06b2146
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion http/filestream/filestream.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package filestream
import (
"errors"
"fmt"
ioutils "github.com/jfrog/gofrog/io"
"io"
"mime/multipart"
"os"

ioutils "github.com/jfrog/gofrog/io"
)

const (
Expand Down Expand Up @@ -67,6 +68,9 @@ func WriteFilesToStream(multipartWriter *multipart.Writer, filesList []*FileInfo

func writeFile(multipartWriter *multipart.Writer, file *FileInfo) (err error) {
fileReader, err := os.Open(file.Path)
if err != nil {
return fmt.Errorf("failed opening %q: %w", file, err)
}
defer ioutils.Close(fileReader, &err)
fileWriter, err := multipartWriter.CreateFormFile(FileType, file.Name)
if err != nil {
Expand Down

0 comments on commit 06b2146

Please sign in to comment.