From 4143bc7a9646e347394e96f52ca8e367ac5aefd9 Mon Sep 17 00:00:00 2001 From: Sakura Date: Wed, 15 Jan 2020 22:54:48 +0800 Subject: [PATCH 1/2] fix staticcheck errors in pkg/volume/hostpath. Signed-off-by: Sakura --- hack/.staticcheck_failures | 1 - pkg/volume/hostpath/host_path_test.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index 02999c23998..767d96b6a1c 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -48,7 +48,6 @@ pkg/volume/emptydir 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_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 } From fe8b32317fffb7fc97d7d7b4226a09ff6b986e52 Mon Sep 17 00:00:00 2001 From: Sakura Date: Fri, 17 Jan 2020 19:34:48 +0800 Subject: [PATCH 2/2] delete unused field Signed-off-by: Sakura --- pkg/volume/hostpath/host_path.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 {