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 issues found by staticcheck #1537

Merged
merged 2 commits into from
Aug 2, 2017
Merged

Fix issues found by staticcheck #1537

merged 2 commits into from
Aug 2, 2017

Conversation

tklauser
Copy link
Contributor

Fix two classes of issues found by staticcheck (honnef.co/go/tools/cmd/staticcheck):

  • Unhandled error return values
  • Ineffective break statements in switch

More details can be found in the commit messages.

Handle err return value of fmt.Scanf, os.Pipe and unix.ParseUnixRights.

Found with honnef.co/go/tools/cmd/staticcheck

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
go's switch statement doesn't need an explicit break. Remove it where
that is the case and add a comment to indicate the purpose where the
removal would lead to an empty case.

Found with honnef.co/go/tools/cmd/staticcheck

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
@dqminh
Copy link
Contributor

dqminh commented Aug 2, 2017

LGTM

CI randomly failed for a few times. i kicked it back in order.

Approved with PullApprove

@crosbymichael
Copy link
Member

crosbymichael commented Aug 2, 2017

LGTM

Approved with PullApprove

@crosbymichael crosbymichael merged commit 882d8ea into opencontainers:master Aug 2, 2017
@tklauser tklauser deleted the staticcheck branch August 17, 2017 09:31
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