add file descriptor close safely in test

Signed-off-by: Cosrider <cosrider7@gmail.com>
pull/2454/head
Cosrider 2 years ago committed by Johannes 'fish' Ziemke
parent b43db0de6e
commit 46748fd229

@ -48,6 +48,8 @@ func TestParseOSRelease(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
defer osReleaseFile.Close()
got, err := parseOSRelease(osReleaseFile) got, err := parseOSRelease(osReleaseFile)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)

Loading…
Cancel
Save