We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sometimes there's a need for this util function:
func convertStateToInt(state string) (int, error) { state = strings.ToUpper(state) switch state { case "OK", "0": return check.OK, nil case "WARNING", "1": return check.Warning, nil case "CRITICAL", "2": return check.Critical, nil case "UNKNOWN", "3": return check.Unknown, nil default: return check.Unknown, errors.New("invalid state") } }
For example when providing a state via a CLI flag.
See:
Should we maybe provide this in the go-check lib?
The text was updated successfully, but these errors were encountered:
@RincewindsHat What do you think?
Sorry, something went wrong.
Funny you should mention that. Thought the same thing :-)
So, yes. I think there is a place in the lib for that.
martialblog
No branches or pull requests
Sometimes there's a need for this util function:
For example when providing a state via a CLI flag.
See:
Should we maybe provide this in the go-check lib?
The text was updated successfully, but these errors were encountered: