moby/runconfig/opts/parse.go
Sebastiaan van Stijn ff447f4fd5
runconfig/opts: use strings.Cut()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-21 11:09:03 +01:00

16 lines
374 B
Go

package opts // import "github.com/docker/docker/runconfig/opts"
import (
"strings"
)
// ConvertKVStringsToMap converts ["key=value"] to {"key":"value"}
func ConvertKVStringsToMap(values []string) map[string]string {
result := make(map[string]string, len(values))
for _, value := range values {
k, v, _ := strings.Cut(value, "=")
result[k] = v
}
return result
}