If the file exists didn't work

This commit is contained in:
Las Zenow 2012-09-09 03:16:43 +02:00
parent e7934c0483
commit 4b30b5c091

View file

@ -145,7 +145,7 @@ func ValidFileName(path string, title string, extension string) string {
file := path + "/" + title + extension
_, err := os.Stat(file)
for i := 0; err == nil; i++ {
file := path + "/" + title + "_" + strconv.Itoa(i) + extension
file = path + "/" + title + "_" + strconv.Itoa(i) + extension
_, err = os.Stat(file)
}
return file