Commit e7f60161 authored by Jakob Borg's avatar Jakob Borg

Don't leak fd

parent ebec4fbc
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment