summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorRadosław Piliszek <radek@piliszek.it>2024-08-27 17:23:02 +0200
committerRadosław Piliszek <radek@piliszek.it>2024-09-16 16:20:55 +0200
commita98cf0e68ed0da866688580ef26557f9211d1c9d (patch)
tree1eae9ad504c62fdbebb044d69b7e0e713dfe0453 /routers
parentui(code-search): fix to use CodeSearchMode (diff)
downloadforgejo-a98cf0e68ed0da866688580ef26557f9211d1c9d.tar.xz
forgejo-a98cf0e68ed0da866688580ef26557f9211d1c9d.zip
code-search: make linters happy again
Diffstat (limited to 'routers')
-rw-r--r--routers/web/explore/code.go4
-rw-r--r--routers/web/user/code.go4
2 files changed, 2 insertions, 6 deletions
diff --git a/routers/web/explore/code.go b/routers/web/explore/code.go
index 7a3f6a5a86..437282cbb1 100644
--- a/routers/web/explore/code.go
+++ b/routers/web/explore/code.go
@@ -35,11 +35,9 @@ func Code(ctx *context.Context) {
language := ctx.FormTrim("l")
keyword := ctx.FormTrim("q")
- isFuzzy := true
+ isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
if mode := ctx.FormTrim("mode"); len(mode) > 0 {
isFuzzy = mode == "fuzzy"
- } else {
- isFuzzy = ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
}
ctx.Data["Keyword"] = keyword
diff --git a/routers/web/user/code.go b/routers/web/user/code.go
index bf4cbb8920..26e48d1ea6 100644
--- a/routers/web/user/code.go
+++ b/routers/web/user/code.go
@@ -40,11 +40,9 @@ func CodeSearch(ctx *context.Context) {
language := ctx.FormTrim("l")
keyword := ctx.FormTrim("q")
- isFuzzy := true
+ isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
if mode := ctx.FormTrim("mode"); len(mode) > 0 {
isFuzzy = mode == "fuzzy"
- } else {
- isFuzzy = ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
}
ctx.Data["Keyword"] = keyword