diff options
author | deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> | 2022-03-06 16:33:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 16:33:45 +0800 |
commit | deec3516d53e9a9679128ade0556ccc818a67be1 (patch) | |
tree | b5c1c5d55be05a244180ece0b822e7e35dc68f42 /internal/route/repo/commit.go | |
parent | 65526f84e1d382ac01b7379f40fc56b2660d1074 (diff) |
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Diffstat (limited to 'internal/route/repo/commit.go')
-rw-r--r-- | internal/route/repo/commit.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |