Skip to content

Commit

Permalink
fix fd lingering'
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyas-goenka committed Dec 31, 2024
1 parent 932aeee commit 9d8ba09
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/filer/dbfs_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestDbfsClientForSmallFiles(t *testing.T) {

// write file to DBFS
fd, err := os.Open(localPath)
defer fd.Close()

Check failure on line 58 in libs/filer/dbfs_client_test.go

View workflow job for this annotation

GitHub Actions / lint

SA5001: should check error returned from os.Open() before deferring fd.Close() (staticcheck)
require.NoError(t, err)
err = dbfsClient.Write(context.Background(), "hello.txt", fd)
require.NoError(t, err)
Expand Down Expand Up @@ -114,6 +115,7 @@ func TestDbfsClientForLargerFiles(t *testing.T) {

// write file to DBFS
fd, err := os.Open(localPath)
defer fd.Close()

Check failure on line 118 in libs/filer/dbfs_client_test.go

View workflow job for this annotation

GitHub Actions / lint

SA5001: should check error returned from os.Open() before deferring fd.Close() (staticcheck)
require.NoError(t, err)
err = dbfsClient.Write(context.Background(), "hello.txt", fd)
require.NoError(t, err)
Expand Down

0 comments on commit 9d8ba09

Please sign in to comment.