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 {