mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 22:23:50 +03:00
code-search: make linters happy again
This commit is contained in:
parent
d2efdda911
commit
a98cf0e68e
3 changed files with 15 additions and 19 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue