cli/command/volume: use strings.Cut

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-12-27 17:44:01 +01:00
parent 806f9eab68
commit acc45f5494
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 4 additions and 4 deletions

View File

@ -165,9 +165,9 @@ func runCreate(dockerCli command.Cli, options createOptions) error {
// comma-separated list of equal separated maps
segments := map[string]string{}
for _, segment := range strings.Split(top, ",") {
parts := strings.SplitN(segment, "=", 2)
// TODO(dperny): validate topology syntax
segments[parts[0]] = parts[1]
k, v, _ := strings.Cut(segment, "=")
segments[k] = v
}
topology.Requisite = append(
topology.Requisite,
@ -180,9 +180,9 @@ func runCreate(dockerCli command.Cli, options createOptions) error {
// comma-separated list of equal separated maps
segments := map[string]string{}
for _, segment := range strings.Split(top, ",") {
parts := strings.SplitN(segment, "=", 2)
// TODO(dperny): validate topology syntax
segments[parts[0]] = parts[1]
k, v, _ := strings.Cut(segment, "=")
segments[k] = v
}
topology.Preferred = append(