diff options
| author | Will Hawkins <[email protected]> | 2021-12-14 08:59:04 -0500 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2021-12-14 08:59:04 -0500 |
| commit | 45b8e5f0e195de0a9c077b4cdab9410f22654699 (patch) | |
| tree | 19061564ff76bf7d9adc7bf9de087152047503ea /utilities/utilities.go | |
| parent | 728a81b8205678abeeb54a69e9e26ee06c18b607 (diff) | |
Add sanity checking for configuration.
Diffstat (limited to 'utilities/utilities.go')
| -rw-r--r-- | utilities/utilities.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utilities/utilities.go b/utilities/utilities.go index fd5c824..54f0f4a 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -8,3 +8,10 @@ func SignedPercentDifference(current float64, previous float64) (difference floa func AbsPercentDifference(current float64, previous float64) (difference float64) { return (math.Abs(current-previous) / (float64(current+previous) / 2.0)) * float64(100) } + +func Conditional(condition bool, t string, f string) string { + if condition { + return t + } + return f +} |
