Skip to content

Fix golangci linter issues#976

Merged
katiewasnothere merged 1 commit intomicrosoft:masterfrom
dcantah:linter-fix
Mar 18, 2021
Merged

Fix golangci linter issues#976
katiewasnothere merged 1 commit intomicrosoft:masterfrom
dcantah:linter-fix

Conversation

@dcantah
Copy link
Contributor

@dcantah dcantah commented Mar 17, 2021

  • Remove unused mutex for the grpc service in ncproxy
  • Remove unnecessary os.Stat call that didn't even check the return value
    facepalm

Signed-off-by: Daniel Canter dcanter@microsoft.com

* 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 <dcanter@microsoft.com>
@dcantah dcantah requested a review from a team as a code owner March 17, 2021 22:39
@dcantah
Copy link
Contributor Author

dcantah commented Mar 17, 2021

This is one of a few PRs to get golangci happy with our repo before we swap over. #975

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.

Copy link

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants