From 1f0be18f23212e317fc5b888103e08702c3c38e3 Mon Sep 17 00:00:00 2001 From: alessio Date: Sun, 21 Aug 2016 13:29:42 +0200 Subject: [PATCH] slash method improved --- realize/watcher.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/realize/watcher.go b/realize/watcher.go index ddc6e30..1f7fbce 100644 --- a/realize/watcher.go +++ b/realize/watcher.go @@ -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]