If the file exists didn't work
This commit is contained in:
parent
e7934c0483
commit
4b30b5c091
1 changed files with 1 additions and 1 deletions
2
admin.go
2
admin.go
|
@ -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
|
||||
|
|
Reference in a new issue