Skip to content

Commit

Permalink
Add missing file close
Browse files Browse the repository at this point in the history
  • Loading branch information
swi-jared committed Jul 30, 2024
1 parent 91668b1 commit e5de4ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/host/k8s/k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func getPodUidFromFile(fn string) (string, error) {

func getPodUidFromProc(fn string) (string, error) {
f, err := os.Open(fn)
defer f.Close()

Check failure on line 172 in internal/host/k8s/k8s.go

View workflow job for this annotation

GitHub Actions / lint

SA5001: should check returned error before deferring f.Close() (staticcheck)
if err != nil {
return "", err
}
Expand Down

0 comments on commit e5de4ad

Please sign in to comment.