Skip to content

Commit a24a0df

Browse files
committed
Code cleanup
Fixed VSCode(gopls check) warnings. Signed-off-by: Ed Bartosh <[email protected]>
1 parent 1057f0e commit a24a0df

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

cmd/cdi/cmd/cdi-api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func cdiListSpecs(verbose bool, format string, vendors ...string) {
271271
fmt.Printf("Vendor %s:\n", vendor)
272272
for _, spec := range cache.GetVendorSpecs(vendor) {
273273
cdiPrintSpec(spec, verbose, format, 2)
274-
cdiPrintSpecErrors(spec, verbose, 2)
274+
cdiPrintSpecErrors(2)
275275
}
276276
}
277277
}
@@ -284,7 +284,7 @@ func cdiPrintSpec(spec *cdi.Spec, verbose bool, format string, level int) {
284284
}
285285
}
286286

287-
func cdiPrintSpecErrors(spec *cdi.Spec, verbose bool, level int) {
287+
func cdiPrintSpecErrors(level int) {
288288
var (
289289
cache = cdi.GetDefaultCache()
290290
cdiErrors = cache.GetErrors()

pkg/cdi/cache_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ devices:
557557
cache = newCache(opts...)
558558
require.NotNil(t, cache)
559559
} else {
560-
err = updateSpecDirs(t, dir, update.etc, update.run)
560+
err = updateSpecDirs(dir, update.etc, update.run)
561561
if err != nil {
562562
t.Errorf("failed to update test directory: %v", err)
563563
return
@@ -743,7 +743,7 @@ devices:
743743
idx = 0
744744
}
745745
update := tc.updates[idx]
746-
err = updateSpecDirs(t, dir, update.etc, update.run)
746+
err = updateSpecDirs(dir, update.etc, update.run)
747747
if err != nil {
748748
return
749749
}
@@ -1851,7 +1851,7 @@ func createSpecDirs(t *testing.T, etc, run map[string]string) (string, error) {
18511851
}
18521852

18531853
// Update spec directories with new data.
1854-
func updateSpecDirs(t *testing.T, dir string, etc, run map[string]string) error {
1854+
func updateSpecDirs(dir string, etc, run map[string]string) error {
18551855
updates := map[string]map[string]string{
18561856
"etc": {},
18571857
"run": {},
@@ -1869,7 +1869,7 @@ func updateSpecDirs(t *testing.T, dir string, etc, run map[string]string) error
18691869
}
18701870
}
18711871
}
1872-
return updateTestDir(t, dir, updates)
1872+
return updateTestDir(dir, updates)
18731873
}
18741874

18751875
func int64ptr(v int64) *int64 {

pkg/cdi/default-cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ devices:
263263
}
264264
Configure(opts...)
265265
} else {
266-
err = updateSpecDirs(t, dir, update.etc, update.run)
266+
err = updateSpecDirs(dir, update.etc, update.run)
267267
if err != nil {
268268
t.Errorf("failed to update test directory: %v", err)
269269
return

pkg/cdi/spec-dirs_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ devices:
201201
return nil
202202
})
203203

204+
require.NoError(t, err)
204205
require.Equal(t, tc.success, success)
205206
require.Equal(t, tc.failure, failure)
206207
require.Equal(t, tc.vendors, vendors)
@@ -220,14 +221,14 @@ func mkTestDir(t *testing.T, dirs map[string]map[string]string) (string, error)
220221
os.RemoveAll(tmp)
221222
})
222223

223-
if err = updateTestDir(t, tmp, dirs); err != nil {
224+
if err = updateTestDir(tmp, dirs); err != nil {
224225
return "", err
225226
}
226227

227228
return tmp, nil
228229
}
229230

230-
func updateTestDir(t *testing.T, tmp string, dirs map[string]map[string]string) error {
231+
func updateTestDir(tmp string, dirs map[string]map[string]string) error {
231232
for sub, content := range dirs {
232233
dir := filepath.Join(tmp, sub)
233234
if err := os.MkdirAll(dir, 0755); err != nil {

0 commit comments

Comments
 (0)