mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-12 22:33:54 -04:00
refactor(worker): iterate node label pairs with SplitSeq (#11806)
Signed-off-by: ginavalent <ginavalent@outlook.com>
This commit is contained in:
1 parent
69a5b54c0a
commit
04bca750d0
1 file changed
+1
-1
@@ -10,7 +10,7 @@ func ParseNodeLabels(input string) map[string]string {
|
||||
if input == "" {
|
||||
return labels
|
||||
}
|
||||
for _, pair := range strings.Split(input, ",") {
|
||||
for pair := range strings.SplitSeq(input, ",") {
|
||||
pair = strings.TrimSpace(pair)
|
||||
if k, v, ok := strings.Cut(pair, "="); ok {
|
||||
labels[strings.TrimSpace(k)] = strings.TrimSpace(v)
|
||||
|
||||
Reference in new issue
Block a user