Skip to content

Commit f88f58c

Browse files
authored
Merge pull request kubernetes#87245 from 928234269/fix_staticcheck
fix staticcheck errors in pkg/volume/hostpath.
2 parents acf64f4 + fe8b323 commit f88f58c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

hack/.staticcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pkg/volume/csi
3030
pkg/volume/fc
3131
pkg/volume/flexvolume
3232
pkg/volume/flocker
33-
pkg/volume/hostpath
3433
pkg/volume/iscsi
3534
pkg/volume/local
3635
pkg/volume/portworx

pkg/volume/hostpath/host_path.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,8 @@ type hostPathTypeChecker interface {
357357
}
358358

359359
type fileTypeChecker struct {
360-
path string
361-
exists bool
362-
hu hostutil.HostUtils
360+
path string
361+
hu hostutil.HostUtils
363362
}
364363

365364
func (ftc *fileTypeChecker) Exists() bool {

pkg/volume/hostpath/host_path_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ func setUp() error {
327327
}
328328

329329
f, err := os.OpenFile("/tmp/ExistingFolder/foo", os.O_CREATE, os.FileMode(0644))
330-
defer f.Close()
331330
if err != nil {
332331
return err
333332
}
333+
defer f.Close()
334334

335335
return nil
336336
}

0 commit comments

Comments
 (0)