From 81a1ce601c06d75d7ae21bcd0e353b6a79dffd99 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Mon, 7 Jul 2025 15:42:19 +0100 Subject: [PATCH] fix(search): fix mutating query state fields Signed-off-by: Babak K. Shandiz --- pkg/search/query.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/search/query.go b/pkg/search/query.go index 0181a2240..4e1990ea2 100644 --- a/pkg/search/query.go +++ b/pkg/search/query.go @@ -149,15 +149,16 @@ func formatQualifiers(qs Qualifiers) []string { } func formatKeywords(ks []string) []string { + result := make([]string, len(ks)) for i, k := range ks { before, after, found := strings.Cut(k, ":") if !found { - ks[i] = quote(k) + result[i] = quote(k) } else { - ks[i] = fmt.Sprintf("%s:%s", before, quote(after)) + result[i] = fmt.Sprintf("%s:%s", before, quote(after)) } } - return ks + return result } // CamelToKebab returns a copy of the string s that is converted from camel case form to '-' separated form.