From bd235e4f8eeb181d106f9673bc0ccbeecfbd130c Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 8 May 2024 10:29:11 +0200 Subject: [PATCH] Split first then trim --- pkg/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index a4a8913..b7df0f4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -59,11 +59,11 @@ func (kv *k8sVersionValue) UnmarshalText(v []byte) error { } func splitCSV(csvStr string) map[string]struct{} { - sanitizedValues := strings.ReplaceAll(csvStr, " ", "") - splitValues := strings.Split(sanitizedValues, ",") + splitValues := strings.Split(csvStr, ",") valuesMap := map[string]struct{}{} for _, kind := range splitValues { + kind = strings.TrimSpace(kind) if len(kind) > 0 { valuesMap[kind] = struct{}{} }