Skip to content

Commit

Permalink
fix: close file in the Upload and Download func
Browse files Browse the repository at this point in the history
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
  • Loading branch information
testwill committed Apr 3, 2024
1 parent 654cfd1 commit 1ead7c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/lfs/filesystem_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (c *FilesystemClient) Download(ctx context.Context, objects []Pointer, call
if err != nil {
return err
}

defer f.Close()
if err := callback(p, f, nil); err != nil {
return err
}
Expand Down Expand Up @@ -75,7 +75,7 @@ func (c *FilesystemClient) Upload(ctx context.Context, objects []Pointer, callba
if err != nil {
return err
}

defer f.Close()
_, err = io.Copy(f, content)

return err
Expand Down

0 comments on commit 1ead7c1

Please sign in to comment.