Bump go version to 1.21

Allows us to use the much faster builtin min/max functions
for two variable min/max
This commit is contained in:
Kovid Goyal
2023-08-09 11:58:16 +05:30
parent f125ffe3e0
commit 49ea26968c
17 changed files with 44 additions and 53 deletions

View File

@@ -30,7 +30,7 @@ func ParseStrDict(val, record_sep, field_sep string) (map[string]string, error)
func PositiveFloat(val string) (ans float64, err error) {
ans, err = strconv.ParseFloat(val, 64)
if err == nil {
ans = utils.Max(0, ans)
ans = max(0, ans)
}
return
}
@@ -38,7 +38,7 @@ func PositiveFloat(val string) (ans float64, err error) {
func UnitFloat(val string) (ans float64, err error) {
ans, err = strconv.ParseFloat(val, 64)
if err == nil {
ans = utils.Max(0, utils.Min(ans, 1))
ans = max(0, min(ans, 1))
}
return
}