From f24c7e803f0a14d35e2bb40a2ed838c80b8cf2e8 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Wed, 6 Sep 2023 07:21:40 -0700 Subject: [PATCH] weed/storage/erasure_coding: Close() after error handling --- weed/storage/erasure_coding/ec_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/storage/erasure_coding/ec_test.go b/weed/storage/erasure_coding/ec_test.go index 676ebdf2c..aa46cf6d4 100644 --- a/weed/storage/erasure_coding/ec_test.go +++ b/weed/storage/erasure_coding/ec_test.go @@ -43,10 +43,10 @@ func TestEncodingDecoding(t *testing.T) { func validateFiles(baseFileName string) error { nm, err := readNeedleMap(baseFileName) - defer nm.Close() if err != nil { return fmt.Errorf("readNeedleMap: %v", err) } + defer nm.Close() datFile, err := os.OpenFile(baseFileName+".dat", os.O_RDONLY, 0) if err != nil {