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 /pkg/api/handlers/libpod | |
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 'pkg/api/handlers/libpod')
-rw-r--r-- | pkg/api/handlers/libpod/images.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go index 979a8adc4..b2b93de17 100644 --- a/pkg/api/handlers/libpod/images.go +++ b/pkg/api/handlers/libpod/images.go @@ -16,7 +16,6 @@ import ( "github.com/containers/podman/v2/libpod" "github.com/containers/podman/v2/libpod/define" "github.com/containers/podman/v2/libpod/image" - image2 "github.com/containers/podman/v2/libpod/image" "github.com/containers/podman/v2/pkg/api/handlers" "github.com/containers/podman/v2/pkg/api/handlers/utils" "github.com/containers/podman/v2/pkg/auth" @@ -524,7 +523,7 @@ func CommitContainer(w http.ResponseWriter, r *http.Request) { utils.Error(w, "failed to get runtime config", http.StatusInternalServerError, errors.Wrap(err, "failed to get runtime config")) return } - sc := image2.GetSystemContext(rtc.Engine.SignaturePolicyPath, "", false) + sc := image.GetSystemContext(rtc.Engine.SignaturePolicyPath, "", false) tag := "latest" options := libpod.ContainerCommitOptions{ Pause: true, |