aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/submodule.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-10-18 03:47:12 +0800
committerGitHub <noreply@github.com>2021-10-17 20:47:12 +0100
commit4a57c9ea17a86e579751025cd0a7c2e6de374726 (patch)
treed9de60079592c541c9e6f2a983ec754199739a2f /modules/git/submodule.go
parent5326f4c9c59cce8a1d8f78afd486ebb8688b45ab (diff)
downloadgitea-4a57c9ea17a86e579751025cd0a7c2e6de374726.tar.gz
gitea-4a57c9ea17a86e579751025cd0a7c2e6de374726.zip
Fix some lints (#17337)
Fix some linting problems.
Diffstat (limited to 'modules/git/submodule.go')
-rw-r--r--modules/git/submodule.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/git/submodule.go b/modules/git/submodule.go
index 231827f1e9..ee61f61179 100644
--- a/modules/git/submodule.go
+++ b/modules/git/submodule.go
@@ -52,9 +52,7 @@ func getRefURL(refURL, urlPrefix, repoFullName, sshDomain string) string {
urlPrefixHostname = prefixURL.Host
}
- if strings.HasSuffix(urlPrefix, "/") {
- urlPrefix = urlPrefix[:len(urlPrefix)-1]
- }
+ urlPrefix = strings.TrimSuffix(urlPrefix, "/")
// FIXME: Need to consider branch - which will require changes in modules/git/commit.go:GetSubModules
// Relative url prefix check (according to git submodule documentation)