added... closing an open file. fucking retard mistake

This commit is contained in:
Jacob 2017-11-30 12:20:32 +01:00
parent 5aebb3a5a2
commit 6d83827bc3

View File

@ -52,18 +52,22 @@ func verifyFolderModification() bool {
f, err := os.Open("./posts") f, err := os.Open("./posts")
if err != nil { if err != nil {
fmt.Println("file-error here: \n", f) fmt.Println("file-error here: \n", f)
f.Close()
return false return false
} }
info, err := f.Stat() info, err := f.Stat()
if err != nil { if err != nil {
fmt.Println("info here: \n", info) fmt.Println("info here: \n", info)
f.Close()
return false return false
} }
_modTime := info.ModTime() _modTime := info.ModTime()
if modTime != _modTime { if modTime != _modTime {
modTime = _modTime modTime = _modTime
f.Close()
return true return true
} }
f.Close()
return false return false
} }