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 return code #8

Merged
merged 2 commits into from
Apr 20, 2022
Merged

Fix return code #8

merged 2 commits into from
Apr 20, 2022

Conversation

pdorschner
Copy link
Contributor

This commit fixes the return code between WARNING and OK

@pdorschner pdorschner requested a review from mocdaniel April 20, 2022 13:07
cmd/query.go Outdated
Comment on lines 64 to 66
} else if total >= 0 {
rc = check.OK
}
Copy link
Member

Choose a reason for hiding this comment

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

Seems like we can leave the whole last else block out.

Copy link
Member

Choose a reason for hiding this comment

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

i.e. just do a

} else {
  rc = check.OK
}

instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've implemented the same "logic" and it should do the trick. If the value is lesser than WARNING

SA4003: every value of type uint is >= 0 (staticcheck)
@mocdaniel mocdaniel merged commit b344608 into main Apr 20, 2022
@mocdaniel mocdaniel deleted the bug/fix_return_code branch April 20, 2022 13:34
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.

2 participants