code-search: make linters happy again

This commit is contained in:
Radosław Piliszek 2024-08-27 17:23:02 +02:00
parent d2efdda911
commit a98cf0e68e
3 changed files with 15 additions and 19 deletions

View file

@ -35,11 +35,9 @@ func Code(ctx *context.Context) {
language := ctx.FormTrim("l") language := ctx.FormTrim("l")
keyword := ctx.FormTrim("q") keyword := ctx.FormTrim("q")
isFuzzy := true isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
if mode := ctx.FormTrim("mode"); len(mode) > 0 { if mode := ctx.FormTrim("mode"); len(mode) > 0 {
isFuzzy = mode == "fuzzy" isFuzzy = mode == "fuzzy"
} else {
isFuzzy = ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
} }
ctx.Data["Keyword"] = keyword ctx.Data["Keyword"] = keyword

View file

@ -40,11 +40,9 @@ func CodeSearch(ctx *context.Context) {
language := ctx.FormTrim("l") language := ctx.FormTrim("l")
keyword := ctx.FormTrim("q") keyword := ctx.FormTrim("q")
isFuzzy := true isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
if mode := ctx.FormTrim("mode"); len(mode) > 0 { if mode := ctx.FormTrim("mode"); len(mode) > 0 {
isFuzzy = mode == "fuzzy" isFuzzy = mode == "fuzzy"
} else {
isFuzzy = ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
} }
ctx.Data["Keyword"] = keyword ctx.Data["Keyword"] = keyword