From 2a8e435671186bead0e02b13f55e118724175cce Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 22 Apr 2022 11:51:53 +0200 Subject: enable staticcheck linter Fix many problems reported by the staticcheck linter, including many real bugs! Signed-off-by: Paul Holzinger --- cmd/podman/containers/create.go | 6 ++---- cmd/podman/volumes/unmount.go | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/containers/create.go b/cmd/podman/containers/create.go index bbc449a1e..b202e404f 100644 --- a/cmd/podman/containers/create.go +++ b/cmd/podman/containers/create.go @@ -286,8 +286,6 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra if !isInfra && c.Flag("entrypoint").Changed { val := c.Flag("entrypoint").Value.String() vals.Entrypoint = &val - } else if isInfra && c.Flag("infra-command").Changed { - } // Docker-compatibility: the "-h" flag for run/create is reserved for @@ -297,7 +295,7 @@ func CreateInit(c *cobra.Command, vals entities.ContainerCreateOptions, isInfra } func PullImage(imageName string, cliVals entities.ContainerCreateOptions) (string, error) { - pullPolicy, err := config.ValidatePullPolicy(cliVals.Pull) + pullPolicy, err := config.ParsePullPolicy(cliVals.Pull) if err != nil { return "", err } @@ -383,7 +381,7 @@ func createPodIfNecessary(cmd *cobra.Command, s *specgen.SpecGenerator, netOpts podSpec := entities.PodSpec{} podGen := specgen.NewPodSpecGenerator() podSpec.PodSpecGen = *podGen - podGen, err = entities.ToPodSpecGen(*&podSpec.PodSpecGen, &createOptions) + podGen, err = entities.ToPodSpecGen(podSpec.PodSpecGen, &createOptions) if err != nil { return nil, err } diff --git a/cmd/podman/volumes/unmount.go b/cmd/podman/volumes/unmount.go index dd0cebc06..af79e49ef 100644 --- a/cmd/podman/volumes/unmount.go +++ b/cmd/podman/volumes/unmount.go @@ -37,7 +37,6 @@ func volumeUnmount(cmd *cobra.Command, args []string) error { return err } for _, r := range reports { - var errs utils.OutputErrors if r.Err == nil { fmt.Println(r.Id) } else { -- cgit v1.2.3-54-g00ecf