1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

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")
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

View file

@ -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