summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/storage.go
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2021-01-12 15:16:12 +0100
committerPaul Holzinger <paul.holzinger@web.de>2021-01-12 16:11:09 +0100
commit8452b768ec96e84cd09766bddb65a34835844d6d (patch)
tree8258e7e73eb71fd76a1022d3b38ef6257c1234b4 /pkg/specgen/generate/storage.go
parent56819073147bec22badd6b5e424cd981d3383398 (diff)
downloadpodman-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/specgen/generate/storage.go')
-rw-r--r--pkg/specgen/generate/storage.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/pkg/specgen/generate/storage.go b/pkg/specgen/generate/storage.go
index f523ac5bf..63713726e 100644
--- a/pkg/specgen/generate/storage.go
+++ b/pkg/specgen/generate/storage.go
@@ -124,14 +124,10 @@ func finalizeMounts(ctx context.Context, s *specgen.SpecGenerator, rt *libpod.Ru
// named volumes, and vice versa.
// We'll delete the conflicts here as we supersede.
for dest := range unifiedMounts {
- if _, ok := baseVolumes[dest]; ok {
- delete(baseVolumes, dest)
- }
+ delete(baseVolumes, dest)
}
for dest := range unifiedVolumes {
- if _, ok := baseMounts[dest]; ok {
- delete(baseMounts, dest)
- }
+ delete(baseMounts, dest)
}
// Supersede volumes-from/image volumes with unified volumes from above.