Skip to content

Commit

Permalink
♻️ refactor: simplify file close logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gopkg-dev committed Nov 11, 2024
1 parent 21224dd commit 0b29269
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ func (*DefaultCtx) SaveFileToStorage(fileheader *multipart.FileHeader, path stri
if err != nil {
return fmt.Errorf("failed to open: %w", err)
}
defer file.Close()
defer func() { _ = file.Close() }() //nolint:errcheck // not needed

content, err := io.ReadAll(file)
if err != nil {
Expand Down

0 comments on commit 0b29269

Please sign in to comment.