From cd57213fb88522c492c8e2097b425595365b72e6 Mon Sep 17 00:00:00 2001 From: Daniel Canter Date: Wed, 17 Mar 2021 15:35:59 -0700 Subject: [PATCH] Fix golangci linter issues * Remove unused mutex for the grpc service in ncproxy * Remove unneccessary os.Stat call that didn't even check the return value *facepalm* Signed-off-by: Daniel Canter --- cmd/ncproxy/ncproxy.go | 1 - computestorage/helpers.go | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cmd/ncproxy/ncproxy.go b/cmd/ncproxy/ncproxy.go index a466069264..3610be8a12 100644 --- a/cmd/ncproxy/ncproxy.go +++ b/cmd/ncproxy/ncproxy.go @@ -25,7 +25,6 @@ import ( // GRPC service exposed for use by a Node Network Service. Holds a mutex for // updating global client. type grpcService struct { - m sync.Mutex } var _ ncproxygrpc.NetworkConfigProxyServer = &grpcService{} diff --git a/computestorage/helpers.go b/computestorage/helpers.go index d31efd6609..93546f34d7 100644 --- a/computestorage/helpers.go +++ b/computestorage/helpers.go @@ -72,9 +72,7 @@ func SetupContainerBaseLayer(ctx context.Context, layerPath, baseVhdPath, diffVh if err != nil { syscall.CloseHandle(handle) os.RemoveAll(baseVhdPath) - if os.Stat(diffVhdPath); err == nil { - os.RemoveAll(diffVhdPath) - } + os.RemoveAll(diffVhdPath) } }() @@ -150,9 +148,7 @@ func SetupUtilityVMBaseLayer(ctx context.Context, uvmPath, baseVhdPath, diffVhdP if err != nil { syscall.CloseHandle(handle) os.RemoveAll(baseVhdPath) - if os.Stat(diffVhdPath); err == nil { - os.RemoveAll(diffVhdPath) - } + os.RemoveAll(diffVhdPath) } }()