From ba9bcf92f68ef2ed48f8843898828871c25825dc Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 31 Oct 2022 15:18:52 +0100 Subject: [PATCH] api/types/filters: use strings.Cut() Signed-off-by: Sebastiaan van Stijn --- api/types/filters/parse.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/types/filters/parse.go b/api/types/filters/parse.go index 52c190ec79..e1b84df817 100644 --- a/api/types/filters/parse.go +++ b/api/types/filters/parse.go @@ -166,13 +166,13 @@ func (args Args) MatchKVList(key string, sources map[string]string) bool { } for value := range fieldValues { - testKV := strings.SplitN(value, "=", 2) + testK, testV, hasValue := strings.Cut(value, "=") - v, ok := sources[testKV[0]] + v, ok := sources[testK] if !ok { return false } - if len(testKV) == 2 && testKV[1] != v { + if hasValue && testV != v { return false } }