mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-18 01:17:03 +00:00
Split first then trim
This commit is contained in:
parent
0f7841b715
commit
bd235e4f8e
1 changed files with 2 additions and 2 deletions
|
|
@ -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{}{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue