diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index 78ab627f37d..9d40a346470 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -30,7 +30,6 @@ pkg/volume/csi pkg/volume/fc pkg/volume/flexvolume pkg/volume/flocker -pkg/volume/hostpath pkg/volume/iscsi pkg/volume/local pkg/volume/portworx diff --git a/pkg/volume/hostpath/host_path.go b/pkg/volume/hostpath/host_path.go index af10f49ed54..40dfcaabe7a 100644 --- a/pkg/volume/hostpath/host_path.go +++ b/pkg/volume/hostpath/host_path.go @@ -357,9 +357,8 @@ type hostPathTypeChecker interface { } type fileTypeChecker struct { - path string - exists bool - hu hostutil.HostUtils + path string + hu hostutil.HostUtils } func (ftc *fileTypeChecker) Exists() bool { diff --git a/pkg/volume/hostpath/host_path_test.go b/pkg/volume/hostpath/host_path_test.go index fa94755b1bc..86b5a69a19c 100644 --- a/pkg/volume/hostpath/host_path_test.go +++ b/pkg/volume/hostpath/host_path_test.go @@ -327,10 +327,10 @@ func setUp() error { } f, err := os.OpenFile("/tmp/ExistingFolder/foo", os.O_CREATE, os.FileMode(0644)) - defer f.Close() if err != nil { return err } + defer f.Close() return nil }