1
0
mirror of https://github.com/docker/cli.git synced 2026-01-22 03:22:01 +03:00

remove redundant conversions and braces

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2022-12-27 15:59:57 +01:00
parent 0359f8eeee
commit d84256132d
4 changed files with 12 additions and 17 deletions

View File

@@ -390,7 +390,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
)
if len(copts.Args) > 0 {
runCmd = strslice.StrSlice(copts.Args)
runCmd = copts.Args
}
if copts.entrypoint != "" {
@@ -529,13 +529,11 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
if haveHealthSettings {
return nil, errors.Errorf("--no-healthcheck conflicts with --health-* options")
}
test := strslice.StrSlice{"NONE"}
healthConfig = &container.HealthConfig{Test: test}
healthConfig = &container.HealthConfig{Test: strslice.StrSlice{"NONE"}}
} else if haveHealthSettings {
var probe strslice.StrSlice
if copts.healthCmd != "" {
args := []string{"CMD-SHELL", copts.healthCmd}
probe = strslice.StrSlice(args)
probe = []string{"CMD-SHELL", copts.healthCmd}
}
if copts.healthInterval < 0 {
return nil, errors.Errorf("--health-interval cannot be negative")