2023-01-26 20:58:13 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2023-01-28 13:23:31 +00:00
|
|
|
func ifFloatRange(variable float64, min float64, max float64, includeMin bool, includeMax bool) bool {
|
|
|
|
a, b := false, false
|
|
|
|
|
|
|
|
if includeMin {
|
|
|
|
a = variable >= min
|
|
|
|
} else {
|
|
|
|
a = variable > min
|
|
|
|
}
|
|
|
|
|
|
|
|
if includeMax {
|
|
|
|
b = variable <= max
|
|
|
|
} else {
|
|
|
|
b = variable < max
|
|
|
|
}
|
|
|
|
|
|
|
|
return a && b
|
|
|
|
}
|
|
|
|
|
|
|
|
func stringSplit(input string, sep string) []string {
|
|
|
|
output := *new([]string)
|
|
|
|
for _, element := range strings.Split(input, sep) {
|
|
|
|
if element != "" {
|
|
|
|
output = append(output, element)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return output
|
|
|
|
}
|
|
|
|
|
2023-01-29 12:55:32 +00:00
|
|
|
func stringListContains(list []string, searched string) bool {
|
|
|
|
for _, item := range list {
|
|
|
|
if item == searched {
|
|
|
|
return true
|
2023-01-29 11:55:21 +00:00
|
|
|
}
|
2023-01-28 20:43:07 +00:00
|
|
|
}
|
2023-01-29 12:55:32 +00:00
|
|
|
return false
|
2023-01-28 18:52:41 +00:00
|
|
|
}
|