aboutsummaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorAnirudh Oppiliappan <x@icyphox.sh>2024-07-05 19:56:24 +0300
committerAnirudh Oppiliappan <x@icyphox.sh>2024-07-05 19:56:24 +0300
commit68f08e38aada8d5e8f89679121beef9104430942 (patch)
tree885c0e0e329f815863c69ca7d715965d25deafd8 /routes
parentroutes: ignore files (diff)
downloadlegitrx-68f08e38aada8d5e8f89679121beef9104430942.tar.gz
legitrx-68f08e38aada8d5e8f89679121beef9104430942.tar.zst
legitrx-68f08e38aada8d5e8f89679121beef9104430942.zip
git: fix getDisplayName
Diffstat (limited to 'routes')
-rw-r--r--routes/util.go6
1 files changed, 1 insertions, 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) {