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

Use generics, instead of big.Float and big.ParseFloat #1

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

dsh2dsh
Copy link

@dsh2dsh dsh2dsh commented Mar 14, 2024

Bump module name to v2, because it has incompatible changes.

Args of NewThresholds() must be type of cmp.Ordered and it can't be nil.

Two new methods added to Thresholds type:

UseWarning(useMin, useMax bool)
UseCritical(useMin, useMax bool)

useMin defines is WarningMin or CriticalMin defined or not. useMax does the same for WarningMax or CriticalMax. So instead of calling NewThresholds() with nils, now we should use UseWarning() and/or UseCritical().

Bump module name to `v2`, because it has incompatible changes.

Args of `NewThresholds()` must be type of `cmp.Ordered` and it can't be `nil`.

Two new methods added to `Thresholds` type:

```
UseWarning(useMin, useMax bool)
UseCritical(useMin, useMax bool)
```

`useMin` defines is `WarningMin` or `CriticalMin` defined or not. `useMax` does
the same for `WarningMax` or `CriticalMax`. So instead of calling
`NewThresholds()` with `nil`s, now we should use `UseWarning()` and/or
`UseCritical()`.
There is no `SetWarn()` and `SetCrit()` methods. We use `SetThresholds()` and
`NewThresholds()` instead.
because it automatically uses same type as Value.
which allows replace the default OK message at any time later.
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.

None yet

1 participant