Conversation
status.go
Outdated
| type Status int | ||
|
|
||
| const ( | ||
| Invalid Status = iota - 1 |
There was a problem hiding this comment.
Not sure about this one. I kinda wanted something to "mean" error/invalid and we use a -1 value in result.WorstState.
There was a problem hiding this comment.
That is one problem of the whole monitoring plugins interface, there is no "error" state
There was a problem hiding this comment.
Any ideas? just use Unknown and add some custom error types?
There was a problem hiding this comment.
hm, we could keep an "error" code and map it to "UNKNOWN" at exit, that would be nice from a programer perspective, but also confusing since the end is the same.
There was a problem hiding this comment.
hm, or keep the Status pure and force everyone to use a wrapper with an error.
RincewindsHat
left a comment
There was a problem hiding this comment.
Not ideal, but there is only so much one can do under the given circumstances.
In general I think this is an improvement and we should go with it.
|
sorry @martialblog, I originally wanted to just fix the linter things, but it got out of hand. In that spirit I also removed the residual relations between If all of that was a stupid idea, don't hesitate to revert those commits. |
For the v1 Release we want to introduce a proper State Type for the v1.0.0 - that type can then just implement the Stringer interface and have a NewFromInt/String function.
Fixes #125
This also changes check.ExitRaw to Exit and removes the Exitf.