summaryrefslogtreecommitdiff
path: root/runconfig/opts/parse.go
blob: 834f32d73d4cb5de90a967e24569db7c3c246ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}