From 68f08e38aada8d5e8f89679121beef9104430942 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Fri, 5 Jul 2024 19:56:24 +0300 Subject: git: fix getDisplayName --- routes/util.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/routes/util.go b/routes/util.go index 27c26ce..7d444d0 100644 --- a/routes/util.go +++ b/routes/util.go @@ -17,11 +17,7 @@ func isGoModule(gr *git.GitRepo) bool { } func getDisplayName(name string) string { - l := len(name) - 4 - if name[l:] == ".git" { - name = name[:l] - } - return name + return strings.TrimSuffix(name, ".git") } func getDescription(path string) (desc string) { -- cgit v1.2.3