Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix golangci linter issues #976

Merged
merged 1 commit into from
Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/ncproxy/ncproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
8 changes: 2 additions & 6 deletions computestorage/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing the Stat call, should we be checking the return value?

Copy link
Contributor Author

@dcantah dcantah Mar 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't really even see a need for the stat call. If the file doesn't exist RemoveAll will just silently succeed anyways.

}
}()

Expand Down Expand Up @@ -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)
}
}()

Expand Down