From ad43486cd3ab65b5b023afb5ad5b62aa862d1345 Mon Sep 17 00:00:00 2001 From: Chongyi Zheng Date: Tue, 29 Aug 2023 11:47:26 -0400 Subject: Fix some slice append usages (#26778) Co-authored-by: delvh --- modules/setting/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/setting/service.go b/modules/setting/service.go index 595ea6528f..74a7e90f7c 100644 --- a/modules/setting/service.go +++ b/modules/setting/service.go @@ -223,7 +223,7 @@ func loadServiceFrom(rootCfg ConfigProvider) { Service.UserDeleteWithCommentsMaxTime = sec.Key("USER_DELETE_WITH_COMMENTS_MAX_TIME").MustDuration(0) sec.Key("VALID_SITE_URL_SCHEMES").MustString("http,https") Service.ValidSiteURLSchemes = sec.Key("VALID_SITE_URL_SCHEMES").Strings(",") - schemes := make([]string, len(Service.ValidSiteURLSchemes)) + schemes := make([]string, 0, len(Service.ValidSiteURLSchemes)) for _, scheme := range Service.ValidSiteURLSchemes { scheme = strings.ToLower(strings.TrimSpace(scheme)) if scheme != "" { -- cgit v1.2.3