From 0afab876311a35c56a23b1f7903f9247d5673c8a Mon Sep 17 00:00:00 2001
From: Bo-Yi Wu <appleboy.tw@gmail.com>
Date: Fri, 3 Mar 2017 20:47:24 +0800
Subject: [PATCH] refactor: remove redundant slash. (#1109)

---
 modules/setting/setting.go | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index c0756e30e9..c490fb1d42 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -583,9 +583,7 @@ please consider changing to GITEA_CUSTOM`)
 	sec := Cfg.Section("server")
 	AppName = Cfg.Section("").Key("APP_NAME").MustString("Gitea: Git with a cup of tea")
 	AppURL = sec.Key("ROOT_URL").MustString("http://localhost:3000/")
-	if AppURL[len(AppURL)-1] != '/' {
-		AppURL += "/"
-	}
+	AppURL = strings.TrimRight(AppURL, "/") + "/"
 
 	// Check if has app suburl.
 	url, err := url.Parse(AppURL)