From e7f60161a34f8289704378491f3c611adf8eb04d Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 23 Aug 2014 10:37:58 +0200 Subject: [PATCH] Don't leak fd --- versioner/staggered.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/versioner/staggered.go b/versioner/staggered.go index a31dc7a42..8910fc7d8 100644 --- a/versioner/staggered.go +++ b/versioner/staggered.go @@ -39,15 +39,7 @@ type Staggered struct { // Check if file or dir func isFile(path string) bool { - fileordir := path - file, err := os.Open(fileordir) - if err != nil { - l.Infoln("versioner isFile:", err) - return false - } - defer file.Close() - - fileInfo, err := file.Stat() + fileInfo, err := os.Stat(path) if err != nil { l.Infoln("versioner isFile:", err) return false