From deec3516d53e9a9679128ade0556ccc818a67be1 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 16:33:45 +0800 Subject: autofix: fix check for empty string (#6804) Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> --- internal/route/repo/commit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/route/repo/commit.go') diff --git a/internal/route/repo/commit.go b/internal/route/repo/commit.go index ae424d06..3e09bd06 100644 --- a/internal/route/repo/commit.go +++ b/internal/route/repo/commit.go @@ -25,7 +25,7 @@ const ( func RefCommits(c *context.Context) { c.Data["PageIsViewFiles"] = true switch { - case len(c.Repo.TreePath) == 0: + case c.Repo.TreePath == "": Commits(c) case c.Repo.TreePath == "search": SearchCommits(c) @@ -85,7 +85,7 @@ func SearchCommits(c *context.Context) { c.Data["PageIsCommits"] = true keyword := c.Query("q") - if len(keyword) == 0 { + if keyword == "" { c.Redirect(c.Repo.RepoLink + "/commits/" + c.Repo.BranchName) return } -- cgit v1.2.3