summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-05-19 10:45:28 +0200
committerMatthew Heon <mheon@redhat.com>2022-06-14 13:47:42 -0400
commit31d310a4b1441fb383d4e1cf1ce6d5b17b4c07b5 (patch)
treefeee10b824c32844405d62e63059ae288e0644a3 /cmd/podman
parent74ac2dda297eb315254e805c9a5c9b6a7c3eda89 (diff)
downloadpodman-31d310a4b1441fb383d4e1cf1ce6d5b17b4c07b5.tar.gz
podman-31d310a4b1441fb383d4e1cf1ce6d5b17b4c07b5.tar.bz2
podman-31d310a4b1441fb383d4e1cf1ce6d5b17b4c07b5.zip
linter: enable unconvert linter
Detects unneccessary type conversions and helps in keeping the code base cleaner. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/common/create_test.go4
-rw-r--r--cmd/podman/containers/kill.go2
-rw-r--r--cmd/podman/containers/rm.go2
-rw-r--r--cmd/podman/containers/stop.go2
4 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/common/create_test.go b/cmd/podman/common/create_test.go
index ab41f81ad..80e6cbf54 100644
--- a/cmd/podman/common/create_test.go
+++ b/cmd/podman/common/create_test.go
@@ -28,8 +28,8 @@ func TestPodOptions(t *testing.T) {
for j := 0; j < cc.NumField(); j++ {
containerField := cc.FieldByIndex([]int{j})
containerType := reflect.TypeOf(exampleOptions).Field(j)
- tagPod := strings.Split(string(podType.Tag.Get("json")), ",")[0]
- tagContainer := strings.Split(string(containerType.Tag.Get("json")), ",")[0]
+ tagPod := strings.Split(podType.Tag.Get("json"), ",")[0]
+ tagContainer := strings.Split(containerType.Tag.Get("json"), ",")[0]
if tagPod == tagContainer && (tagPod != "" && tagContainer != "") {
areEqual := true
if containerField.Kind() == podField.Kind() {
diff --git a/cmd/podman/containers/kill.go b/cmd/podman/containers/kill.go
index 32f9899cd..e994fbf2c 100644
--- a/cmd/podman/containers/kill.go
+++ b/cmd/podman/containers/kill.go
@@ -95,7 +95,7 @@ func kill(_ *cobra.Command, args []string) error {
return errors.New("valid signals are 1 through 64")
}
for _, cidFile := range cidFiles {
- content, err := ioutil.ReadFile(string(cidFile))
+ content, err := ioutil.ReadFile(cidFile)
if err != nil {
return errors.Wrap(err, "error reading CIDFile")
}
diff --git a/cmd/podman/containers/rm.go b/cmd/podman/containers/rm.go
index 7e0955863..420e3c38d 100644
--- a/cmd/podman/containers/rm.go
+++ b/cmd/podman/containers/rm.go
@@ -102,7 +102,7 @@ func rm(cmd *cobra.Command, args []string) error {
rmOptions.Timeout = &stopTimeout
}
for _, cidFile := range cidFiles {
- content, err := ioutil.ReadFile(string(cidFile))
+ content, err := ioutil.ReadFile(cidFile)
if err != nil {
return errors.Wrap(err, "error reading CIDFile")
}
diff --git a/cmd/podman/containers/stop.go b/cmd/podman/containers/stop.go
index 381997fee..af2250abb 100644
--- a/cmd/podman/containers/stop.go
+++ b/cmd/podman/containers/stop.go
@@ -100,7 +100,7 @@ func stop(cmd *cobra.Command, args []string) error {
}
for _, cidFile := range cidFiles {
- content, err := ioutil.ReadFile(string(cidFile))
+ content, err := ioutil.ReadFile(cidFile)
if err != nil {
return errors.Wrap(err, "error reading CIDFile")
}