slash method improved

This commit is contained in:
alessio 2016-08-21 13:29:42 +02:00
parent b26146a05e
commit 1f0be18f23
1 changed files with 3 additions and 1 deletions

View File

@ -193,7 +193,9 @@ func slash(str string) string {
str = "/" + str
}
if string(str[len(str)-1]) == "/" {
if string(str) == "/" {
if len(str) == 0 {
return str
} else if string(str) == "/" {
str = ""
} else {
str = str[0 : len(str)-2]