From ff447f4fd5b81cba92665e1c74ebad7d0a334b6d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 1 Nov 2022 12:47:46 +0100 Subject: [PATCH] runconfig/opts: use strings.Cut() Signed-off-by: Sebastiaan van Stijn --- runconfig/opts/parse.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/runconfig/opts/parse.go b/runconfig/opts/parse.go index 8f7baeb637..834f32d73d 100644 --- a/runconfig/opts/parse.go +++ b/runconfig/opts/parse.go @@ -8,12 +8,8 @@ import ( func ConvertKVStringsToMap(values []string) map[string]string { result := make(map[string]string, len(values)) for _, value := range values { - kv := strings.SplitN(value, "=", 2) - if len(kv) == 1 { - result[kv[0]] = "" - } else { - result[kv[0]] = kv[1] - } + k, v, _ := strings.Cut(value, "=") + result[k] = v } return result