aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-03-21 13:44:09 +0100
committerValentin Rothberg <vrothberg@redhat.com>2022-03-22 13:04:34 +0100
commitbb6b69b4abe86601a8438a6708263174879b5c51 (patch)
tree35a34e879c7129ceaac8bac80bdbe7fa9faea631 /cmd
parent070e401499c12d4bdc6e39eaa2498aeda9e96c82 (diff)
downloadpodman-bb6b69b4abe86601a8438a6708263174879b5c51.tar.gz
podman-bb6b69b4abe86601a8438a6708263174879b5c51.tar.bz2
podman-bb6b69b4abe86601a8438a6708263174879b5c51.zip
linter: enable wastedassign
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/create.go4
-rw-r--r--cmd/podman/containers/clone.go3
-rw-r--r--cmd/podman/images/build.go4
-rw-r--r--cmd/podman/images/scp.go4
-rw-r--r--cmd/podman/images/search.go2
5 files changed, 8 insertions, 9 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index f3e2e4d6d..8d9a255ec 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -721,7 +721,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
"Optional parent cgroup for the container",
)
_ = cmd.RegisterFlagCompletionFunc(cgroupParentFlagName, completion.AutocompleteDefault)
- conmonPidfileFlagName := ""
+ var conmonPidfileFlagName string
if !isInfra {
conmonPidfileFlagName = "conmon-pidfile"
} else {
@@ -734,7 +734,7 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
)
_ = cmd.RegisterFlagCompletionFunc(conmonPidfileFlagName, completion.AutocompleteDefault)
- entrypointFlagName := ""
+ var entrypointFlagName string
if !isInfra {
entrypointFlagName = "entrypoint"
} else {
diff --git a/cmd/podman/containers/clone.go b/cmd/podman/containers/clone.go
index d095d24ba..8a1473608 100644
--- a/cmd/podman/containers/clone.go
+++ b/cmd/podman/containers/clone.go
@@ -58,9 +58,8 @@ func clone(cmd *cobra.Command, args []string) error {
case 3:
ctrClone.CreateOpts.Name = args[1]
ctrClone.Image = args[2]
- rawImageName := ""
if !cliVals.RootFS {
- rawImageName = args[0]
+ rawImageName := args[0]
name, err := PullImage(ctrClone.Image, ctrClone.CreateOpts)
if err != nil {
return err
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 729951a31..1f9e7ea9e 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -375,7 +375,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
}
}
- cleanTmpFile := false
+ var cleanTmpFile bool
flags.Authfile, cleanTmpFile = buildahUtil.MirrorToTempFileIfPathIsDescriptor(flags.Authfile)
if cleanTmpFile {
defer os.Remove(flags.Authfile)
@@ -474,7 +474,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
return nil, err
}
- format := ""
+ var format string
flags.Format = strings.ToLower(flags.Format)
switch {
case strings.HasPrefix(flags.Format, buildahDefine.OCI):
diff --git a/cmd/podman/images/scp.go b/cmd/podman/images/scp.go
index d07a5d99d..1a1a9282f 100644
--- a/cmd/podman/images/scp.go
+++ b/cmd/podman/images/scp.go
@@ -105,7 +105,7 @@ func scp(cmd *cobra.Command, args []string) (finalErr error) {
}
locations := []*entities.ImageScpOptions{}
cliConnections := []string{}
- flipConnections := false
+ var flipConnections bool
for _, arg := range args {
loc, connect, err := parseImageSCPArg(arg)
if err != nil {
@@ -233,7 +233,7 @@ func loadToRemote(localFile string, tag string, url *urlP.URL, iden string) (str
errOut := strconv.Itoa(int(n)) + " Bytes copied before error"
return " ", errors.Wrapf(err, errOut)
}
- run := ""
+ var run string
if tag != "" {
return "", errors.Wrapf(define.ErrInvalidArg, "Renaming of an image is currently not supported")
}
diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go
index 292a1d060..aa11cf254 100644
--- a/cmd/podman/images/search.go
+++ b/cmd/podman/images/search.go
@@ -105,7 +105,7 @@ func searchFlags(cmd *cobra.Command) {
// imageSearch implements the command for searching images.
func imageSearch(cmd *cobra.Command, args []string) error {
- searchTerm := ""
+ var searchTerm string
switch len(args) {
case 1:
searchTerm = args[0]