From 8452b768ec96e84cd09766bddb65a34835844d6d Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 12 Jan 2021 15:16:12 +0100 Subject: 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 --- pkg/specgen/generate/config_linux.go | 3 --- 1 file changed, 3 deletions(-) (limited to 'pkg/specgen/generate/config_linux.go') diff --git a/pkg/specgen/generate/config_linux.go b/pkg/specgen/generate/config_linux.go index e0b039fb7..1290a8eb6 100644 --- a/pkg/specgen/generate/config_linux.go +++ b/pkg/specgen/generate/config_linux.go @@ -21,9 +21,6 @@ var ( errNotADevice = errors.New("not a device node") ) -func u32Ptr(i int64) *uint32 { u := uint32(i); return &u } -func fmPtr(i int64) *os.FileMode { fm := os.FileMode(i); return &fm } - func addPrivilegedDevices(g *generate.Generator) error { hostDevices, err := getDevices("/dev") if err != nil { -- cgit v1.2.3-54-g00ecf