diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-01-12 15:16:12 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-01-12 16:11:09 +0100 |
commit | 8452b768ec96e84cd09766bddb65a34835844d6d (patch) | |
tree | 8258e7e73eb71fd76a1022d3b38ef6257c1234b4 /cmd/podman/play/kube.go | |
parent | 56819073147bec22badd6b5e424cd981d3383398 (diff) | |
download | podman-8452b768ec96e84cd09766bddb65a34835844d6d.tar.gz podman-8452b768ec96e84cd09766bddb65a34835844d6d.tar.bz2 podman-8452b768ec96e84cd09766bddb65a34835844d6d.zip |
Fix problems reported by staticcheck
`staticcheck` is a golang code analysis tool. https://staticcheck.io/
This commit fixes a lot of problems found in our code. Common problems are:
- unnecessary use of fmt.Sprintf
- duplicated imports with different names
- unnecessary check that a key exists before a delete call
There are still a lot of reported problems in the test files but I have
not looked at those.
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'cmd/podman/play/kube.go')
-rw-r--r-- | cmd/podman/play/kube.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go index 1f54db203..4c44fa30f 100644 --- a/cmd/podman/play/kube.go +++ b/cmd/podman/play/kube.go @@ -127,23 +127,23 @@ func kube(cmd *cobra.Command, args []string) error { for _, pod := range report.Pods { for _, l := range pod.Logs { - fmt.Fprintf(os.Stderr, l) + fmt.Fprint(os.Stderr, l) } } ctrsFailed := 0 for _, pod := range report.Pods { - fmt.Printf("Pod:\n") + fmt.Println("Pod:") fmt.Println(pod.ID) switch len(pod.Containers) { case 0: continue case 1: - fmt.Printf("Container:\n") + fmt.Println("Container:") default: - fmt.Printf("Containers:\n") + fmt.Println("Containers:") } for _, ctr := range pod.Containers { fmt.Println(ctr) @@ -154,7 +154,7 @@ func kube(cmd *cobra.Command, args []string) error { fmt.Println() } for _, err := range pod.ContainerErrors { - fmt.Fprintf(os.Stderr, err+"\n") + fmt.Fprintln(os.Stderr, err) } // Empty line for space for next block fmt.Println() |