mirror of https://github.com/docker/cli.git
cli/command/volume: use strings.Cut
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
806f9eab68
commit
acc45f5494
|
@ -165,9 +165,9 @@ func runCreate(dockerCli command.Cli, options createOptions) error {
|
||||||
// comma-separated list of equal separated maps
|
// comma-separated list of equal separated maps
|
||||||
segments := map[string]string{}
|
segments := map[string]string{}
|
||||||
for _, segment := range strings.Split(top, ",") {
|
for _, segment := range strings.Split(top, ",") {
|
||||||
parts := strings.SplitN(segment, "=", 2)
|
|
||||||
// TODO(dperny): validate topology syntax
|
// TODO(dperny): validate topology syntax
|
||||||
segments[parts[0]] = parts[1]
|
k, v, _ := strings.Cut(segment, "=")
|
||||||
|
segments[k] = v
|
||||||
}
|
}
|
||||||
topology.Requisite = append(
|
topology.Requisite = append(
|
||||||
topology.Requisite,
|
topology.Requisite,
|
||||||
|
@ -180,9 +180,9 @@ func runCreate(dockerCli command.Cli, options createOptions) error {
|
||||||
// comma-separated list of equal separated maps
|
// comma-separated list of equal separated maps
|
||||||
segments := map[string]string{}
|
segments := map[string]string{}
|
||||||
for _, segment := range strings.Split(top, ",") {
|
for _, segment := range strings.Split(top, ",") {
|
||||||
parts := strings.SplitN(segment, "=", 2)
|
|
||||||
// TODO(dperny): validate topology syntax
|
// TODO(dperny): validate topology syntax
|
||||||
segments[parts[0]] = parts[1]
|
k, v, _ := strings.Cut(segment, "=")
|
||||||
|
segments[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
topology.Preferred = append(
|
topology.Preferred = append(
|
||||||
|
|
Loading…
Reference in New Issue